There is a Visual C++ runtime library function called _controlfp() which sets
the IEEE floating-point status word. The syntax is _controlfp(value, mask);
the mask indicates which bits of the status word you want to change. There
are lots of constants defined for various parts of this word. In order to set
round-to-nearest mode, the syntax would be:
_controlfp(_RC_NEAR, _MCW_RC);
The other rounding mode choices are _RC_CHOP, _RC_UP, and _RC_DOWN.
-------------------------------------------------------------------------------
-- Fred Gray Graduate Student --
-- fgray@physics.uiuc.edu Department of Physics --
-- University of Illinois at Urbana-Champaign --
-------------------------------------------------------------------------------