更新时间:2018-11-22 15:55作者:王新老师
return span;
}
friend bool operator==(int128 const& i,int const k)
{
bitset<32> bb(k);
for(int g = 0 ; g < 32 ; ++g)
{
if(i[g] != bb[g])
return 0;
}
return 1;
}
void operator=(bitset<128>const& b)
{
number = b;
}
friend ostream& operator<<(ostream& o,int128 const& i)
{
o<
return o;
}
int128 operator<<(size_t step)const
{
return int128(number<
}
unsigned long to_ulong()const
{
return *((unsigned long*)&number);
}
public:
bool ToDecimalStr(std::string &str)
{
str.clear();
char buf[128] = {0};
int128 Radix(0, 0, 0, 10);
for(int128 num = number; !(num == 0); num = num/Radix)
{
if( sprintf_s(buf, 64, "%d", ((int)(num%Radix).to_ulong())) < 0 )