Borland C++ reference

_control87

partly corrected

Manipulates the floating-point control word.

Defined in header <float.h>

Syntax

#include <float.h>
unsigned  int _control87(unsigned  int newczv, unsigned int mask);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

_control87 retrieves or changes the floating-point control word.

The floating-point control word is an unsigned int that, bit by bit, specifies certain modes in the floating-point package; namely, the precision, infinity, and rounding modes. Changing these modes allows you to mask or unmask floating-point exceptions.

_control87 matches the bits in mask to the bits in newczv. If a mask bit equals 1, the corresponding bit in newczv contains the new value for the same bit in the floating-point control word, and _control87 sets that bit in the control word to the new value.

Here's a simple illustration:

Original control word:01000011Olio0011
mask1000000101001111
newcw1110100100000101
Changing bitsIxxxxxx\xQxx0101

If mask equals 0, _control87 returns the floating-point control word without altering it.

_control87 does not change the Denormal bit because Borland C++ uses denormal exceptions.

Return value

The bits in the value returned reflect the new floating-point control word. For a complete definition of the bits returned by _control87, see the header file float.h.

See also

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.