Overflow Exceptions

For applications that require overflow floating-point exceptions, imprecise exceptions (default) can be used, or the default compiler behavior can be changed by using the /QAieee switch. If the /QAieee switch is used, the Windows NT behavior must be changed to enable divide-by-zero exceptions by calling _ _controlfp(0, EM_OVERFLOW).

The default behavior when the /QAieee switch is used is that an overflow generates an infinite value and no exception is raised. Divide-by-zero exceptions can subsequently be disabled by calling _ _controlfp(EM_OVERFLOW, EM_OVERFLOW). For both calls, _ _controlfp creates additional overhead.

The underflow status bit is set when a floating-point operation underflows. The status bit is set regardless of whether the underflow exception is masked or unmasked. Having the status bit set does not result in underflow exceptions on subsequent floating-point instructions. For compatibility with other types of processors, however, you should clear the bit with _ _clearfp() when underflow exceptions are unmasked.