c/c++ 使用比long long还大的类型

当发现long long的值不足以存放一些组合数值的时候,可以考虑使用__int128


如果发现所在的环境并不能支持__int128的数据类型的时候,可能需要考虑自己编写相应的struct类型来拓展符合自己的__int128位

如:

struct MyInt128 {

long long x;

long long y;

bool operator <(const struct MyInt128 &t) {...}

bool operator <=(const struct MyInt128 &t) {...}

bool operator >..

bool operator >=..

bool operator ==...

bool operator !=...

};

你可能感兴趣的:(语言_cc++,操作系统_linux)