_control87
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
| DOS | UNIX | Windows | ANSI C | C++ 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: | 0100 | 0011 | Olio | 0011 |
| mask | 1000 | 0001 | 0100 | 1111 |
| newcw | 1110 | 1001 | 0000 | 0101 |
| Changing bits | Ixxx | xxx\ | xQxx | 0101 |
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.
Stable link: /3.1/float.h/_control87/
· short form /3.1/_control87/