asm volatile("fldcw %0" : : "m" (0x037f));
volatile unsigned short int control_word = 0x037f; asm volatile("fldcw %0" : : "m" (control_word));
inline void initialize_fpu(){#if defined __GNUC__ && defined _X86_    asm volatile("fldcw %0" : : "m" (0x037f));#elif defined __BORLANDC__    _control87(0x037f, 0xffff);#elif defined _MSC_VER    // Test _MSC_VER last because some non-ms compilers or libraries    // define it.    //    // The ms implementation of _control87(), strangely enough, takes    // an argument that is not identical to the hardware control word.    //   http://groups.google.com/groups?selm=34775BB8.E10BA020%40tc.umn.edu    // Instead of writing    //   _control87(0x08001f,  0xffffffff);    // which would be correct for ms but incorrect for borland and    // perhaps for some other compilers, it is better to use these ms    // macros, which are not defined by borland or presumably by other    // compilers that use the intel control word as an argument.    //    _control87(_MCW_EM,  _MCW_EM);    _control87(_RC_NEAR, _MCW_RC);    _control87(_PC_64,   _MCW_PC);#else // Unknown compiler or platform.#   error Unknown compiler or platform. Please contribute an implementation.#endif // Unknown compiler or platform.    // The facilities offered by C99's <fenv.h> are useful, but not    // sufficient: they require no standard way to set hardware    // precision, although 7.6/9 provides for extensions like mingw's    // FE_PC64_ENV.#ifdef __STDC_IEC_559__#   ifndef __MINGW32__    // Hardware precision not set.    fenv_t save_env;    feholdexcept(&save_env);    fesetround(FE_TONEAREST);#   else // __MINGW32__    fesetenv(FE_PC64_ENV);#   endif // __MINGW32__#endif // __STDC_IEC_559__}