Floating-Point Denormals

All Windows NT platforms use identical IEEE floating-point formats. The Alpha platform handles finite floating-point values in the same way as x86, but it handles nonfinite floating-point values differently.

By default, the Alpha compiler generates code that raises an imprecise floating-point exception when nonfinite floating-point values are encountered or when division by zero or overflow occurs. The instruction that raised the exception might be located prior to where the trap occurred. The status code of the exception will be one of the following:

Status_Float_Divide_By_Zero

Status_Float_Invalid_Operation

Status_Float_Overflow

Status_Float_Underflow

Status_Float_Inexact_Result

The default behavior on x86 is to create an IEEE masked result, set a bit in the fspr, and for the hardware to raise no exception. Programs that require the default nonfinite x86 floating-point behavior must:

Note that _controlfp(_DN_SAVE, _MCW_DN)is optional. The /QAieee switch will cause the compiler to generate code so that the RTL and operating system can find the faulting floating-point instruction. The _controlfp function tells the operating system that it must maintain denormal values instead of the default behavior, which is to turn them into zeroes. The _controlfp function is only important to use in applications that require the extra bits of precision to work. A better solution is to use numerically stable algorithms.

If one of the exceptions listed above is raised, the location of the exception may not be where the trap occurred. From the debugger, look for the exception at the instructions preceding the error. If you are still having trouble locating the exception, the /QApe switch might help.