标签:
long long unsigned intToUnsigned (const int& i)
{
return static_cast<long long unsigned>(i >= 0 ? i : (i + pow (2.0, 32.0)));
}
int UnsignedToInt (const long long unsigned& u)
{
auto limit = static_cast<long long unsigned>(pow(2.0, 32.0));
return static_cast<int>(limit < u? (u - limit) : u);
}
标签:
原文地址:http://www.cnblogs.com/wuOverflow/p/4539544.html