Underflow Exceptions

For applications that require underflow exceptions, the default compiler behavior must be changed by using the /QAieee switch. The Windows NT behavior can then be changed to enable underflows to denormal values and to enable their associated exceptions by calling _ _controlfp(_DN_SAVE | 0, _MCW_DN | EM_UNDERFLOW). By default Windows NT silently rounds denormal values to zero. Underflow exceptions can subsequently be disabled by calling _controlfp(EM_UNDERFLOW, EM_UNDERFLOW). In both cases, calling _ _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.