是否有将uintmax_t
转换为mpz_t
的便携式方法?
在OSX上使用clang编译以下代码失败,因为没有uint64_t的构造函数用于mpz_class。
const mpz_class maxUint64 = std::numeric_limits<uint64_t>::max();
错误:从'type'(又名'unsigned long long')到'const mpz_class'(又名'const __gmp_expr&lt; __ mpz_struct [1],__ mpz_struct [1]&gt;')的转换是不明确的 static const mpz_class maxUint64 = std :: numeric_limits :: max();