更新时间:2018-11-22 15:55作者:才子老师
flag = 1;
de.push_back(i1[i]);
}
}
int128 span = int128();
int128 result = int128();
while(!de.empty())
{
shift(span,de);
if(span < i2)
{
result = result<<1;
}
else
{
result = (result<<1) + int128(0,0,0,1);
span = span - i2;
}
}
return result;
}
friend int128 operator%(int128 const& i1,int128 const& i2)
{
if(i1 < i2)
return i1;
deque de;
bool flag = 0;
for(int i = 127 ; i >= 0 ; --i)
{
if(flag == 0 && i1[i] == 0) {}
else
{
flag = 1;
de.push_back(i1[i]);
}
}
int128 span = int128();
int128 result = int128();
while(!de.empty())
{
shift(span,de);
if(span < i2)
{
result = result<<1;
}
else
{
result = (result<<1) + int128(0,0,0,1);
span = span - i2;
}
}