
26 Jan
2012
26 Jan
'12
10:12 a.m.
It took me some time to figure out that convert_to<double>() method doesn't work properly for negative integers (Please correct me if I'm wrong). Here is the code snippet:
#include "boost/multiprecision/fixed_int.hpp" using namespace boost::multiprecision;
int main() { mp_int512_t a = 1; double da = a.convert_to<double>(); mp_int512_t b = -1; double db = b.convert_to<double>(); std::cout << da << std::endl; // Outputs: 1 std::cout << db << std::endl; // Outputs: 1.34078e+154 return 0; }
As soon as this fix is ready, I'll be able to finish benchmark.
Ugh. Looks like that slipped through the test cases. That and a couple other bugs fixed in SVN. Cheers, John.