initialize_fpu();
int test_all_modes(bool synchronize){    // As stated above, we'd like this to be true for all    // floating-point types:    //   X == 1.0e0 * X * 1.0e-0    // But this is not generally true for long doubles with the    // www.mingw.org variant of gcc2.95.2-1, which uses a 80-bit    // 'extended-real' format with a 64-bit mantissa for long doubles,    // but by default initializes the floating-point hardware to use    // only a 53-bit mantissa. Until we have facilities like C99's    // <fenv.h>, we have to fix that in a nonstandard way.#if defined __GNUC__ && defined _X86_    // Set floating-point control word to intel default.    asm volatile ("fldcw %0" : : "m" (0x037f));#elif defined __BORLANDC__    _control87(0x037f,  0xffff);#elif defined BOOST_MSVC    // Untested, but this appears to be the right nonstandard function.    _control87(0x001f,   _MCW_EM);    _control87(_RC_NEAR, _MCW_RC);    _control87(_PC_64,   _MCW_PC);#else // No known way to set rounding style.    std::cerr        << "\nCannot set floating-point hardware control word.\n"        << "Results may be invalid.\n"        << "Please consider contributing an implementation\n"        << "for your compiler and platform.\n"        ;#endif // No known way to set rounding style.    // It is anticipated that a rounding functor will typically be    // created once and used many times, like this:    round_to<double> const RoundToNearestHundredth(2, r_to_nearest);    double sample_value = 1.0;    for(int j = 0; j < 1000; j++)        {        sample_value *= 1.05;        sample_value = RoundToNearestHundredth(sample_value);        }    // Most of this test suite is by its nature not typical in that sense.    int hardware_rounding_mode = fe_tonearest;    set_hardware_rounding_mode(hardware_rounding_mode, synchronize);    std::cout        << "    hardware rounding mode: "        << get_name_of_hardware_rounding_mode(hardware_rounding_mode)        << std::endl        ;    test_rounding();    hardware_rounding_mode = fe_downward;    set_hardware_rounding_mode(hardware_rounding_mode, synchronize);    std::cout        << "    hardware rounding mode: "        << get_name_of_hardware_rounding_mode(hardware_rounding_mode)        << std::endl        ;    test_rounding();    hardware_rounding_mode = fe_upward;    set_hardware_rounding_mode(hardware_rounding_mode, synchronize);    std::cout        << "    hardware rounding mode: "        << get_name_of_hardware_rounding_mode(hardware_rounding_mode)        << std::endl        ;    test_rounding();    hardware_rounding_mode = fe_towardzero;    set_hardware_rounding_mode(hardware_rounding_mode, synchronize);    std::cout        << "    hardware rounding mode: "        << get_name_of_hardware_rounding_mode(hardware_rounding_mode)        << std::endl        ;    test_rounding();    return 0;}