可以吗?如果是,那么如何?
是的,它可能可能做到,但不是一个简单的C风格演员。
以下是手册中Integer类的文档:Integer Class Reference。在标题存取,有两种方法:
bool IsConvertableToLong() const
确定是否该整数是可转换到长。更多...
signed long ConvertToLong() const
将Integer转换为Long。更多...
所以,你需要做的是这样的:
int low_bound1, low_bound2;
Integer x=1,y=2;
if (x > std::numeric_limits<int>::max() || x < std::numeric_limits<int>::min())
throw std::out_of_range("Integer x does not fit int data type");
if (y > std::numeric_limits<int>::max() || y < std::numeric_limits<int>::min())
throw std::out_of_range("Integer y does not fit int data type");
low_bound1 = static_cast<int>(x.ConvertToLong());
low_bound2 = static_cast<int>(y.ConvertToLong());
来源
2017-02-11 15:05:23
jww
这是一个多精度整数(它可以存储值太大,不能用内建类型持有):具有转换方法:HTTPS ://www.cryptopp.com/docs/ref/class_integer.html例如https://www.cryptopp.com/docs/ref/class_integer.html#a2e90d8f4c5a13e203b94f9abc24d733f –
谢谢,它帮助! –