FIX: Floating Point Exception Incorrect Under Win32s

Last reviewed: October 29, 1997
Article ID: Q150405
1.30 WINDOWS kbprg kbbuglist kbfixlist

The information in this article applies to:

  • Microsoft Win32s version 1.3

SYMPTOMS

There are some inconsistencies in floating point exception handling under Win32s and Windows NT platforms. For example, the following code causes a underflow on both platforms as expected and the exception is masked:

   d1 = pow(1000000, -53);

However, the following code:

   d2 = 1/d1;

causes this behavior:

   Windows NT 3.51     -  Floating point Overflow.
   Windows 3.1/Win32s  -  Denormal operand error

The overflow exception under Windows NT is correct, but the result under Win32s is not.

RESOLUTION

If you examine the exception record, you can see that the denormal operand status bit is set but the exception is masked in the control word. On the other hand, the overflow exception status bit is also set and the exception is unmasked. Even though the exception indication is incorrect, you can get the correct exception by examining the status and control words appropriately.

STATUS

Microsoft has confirmed this to be a bug in Win32s version 1.30. Win32s incorrectly sets the floating point exception in the above case to a Denormal operand error instead of an Overflow exception. This problem has been corrected in Win32s version 1.30c.


Additional reference words: 1.30 win32s fp error
KBCategory: kbprg kbbuglist kbfixlist
KBSubcategory: w32s
Keywords : W32s kbbuglist kbfixlist kbprg
Version : 1.30
Platform : WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.