Division-by-Zero Exceptions

For applications that require division-by-zero floating-point exceptions, either the default imprecise exceptions can be used or the default compiler behavior can be changed by using the /QAieee switch. If the /QAieee switch is used, then the Windows NT behavior must be changed to enable divide-by-zero exceptions by calling _ _controlfp(0, EM_ZERODIVIDE). If the /QAieee switch is used, a divide-by-zero operation generates an infinite value and no exception is raised. Divide-by-zero exceptions can subsequently be disabled by calling _ _controlfp(EM_ZERODIVIDE, EM_ZERODIVIDE). 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.