#include #include typedef boost::multiprecision::number > ext_float_t; int main(int, char**) { ext_float_t a("1e500000000"); ext_float_t neginf = (-a)*a; // -inf ext_float_t x = -42; std::cout << x << " - " << neginf << " = " << x-neginf << "\n" ; return 0; }