Re: TAxis bug

From: Fred Gray (fgray@alecto.physics.uiuc.edu)
Date: Fri Apr 10 1998 - 06:22:44 MEST


> I have investigated your problem on all Unix platforms and NT.
> NT is effectively given the "wrong" result. All Unix platforms are OK.
> The problem on NT is simply a rounding error problem. It is not a bug.
> May be there is an option (Valery please could you check) to optimize
> floating point rounding with VC++.

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 --
-------------------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:31 MET