
24 Apr
2013
24 Apr
'13
10:32 a.m.
There is an explicit conversion from cpp_int to cpp_dec_float, but no conversion in the opposite direction (in general it's unsafe).
Forgot to say: if you really must convert from cpp_dec_lfoat to cpp_int you could do: cpp_int i(my_big_float.str(0, std::ios_base::fixed)); Just make sure the float really is an integer first (use ceil/floor/trunc/round if necessary) otherwise the conversion will fail. HTH, John.