Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

INFO: Excel May Change the Precision Mode of the Floating-Point Control Word


View products that this article applies to.

This article was previously published under Q263213

↑ Back to the top


Summary

Microsoft Excel may change the precision mode of the floating-point control word during its execution. Because of this, C/C++ DLLs called from Excel that use the standard run-time library may return slightly different results than expected. The difference is typically less than 10E-15.

↑ Back to the top


More information

C/C++ DLLs or XLLs designed to be used from Excel should link to the FP10.OBJ library. The Microsoft C/C++ run-time library sets the default internal precision of the math coprocessor (or emulator) to 64 bits. By linking your project with FP10.OBJ, you override this default and set the chip to utilize 80-bit precision. FP10.OBJ must appear before Libc.lib, Libcmt.lib, or Msvcrt.lib on the linker command line. By linking to FP10.OBJ, you should see more consistent results. However, even when utilizing 80-bits, Excel is still limited to 15 digits of precision because of its adherence to the IEEE 754 specification.

↑ Back to the top


References

78113� XL: Floating-Point Arithmetic May Give Inaccurate Results
125056� INFO: Precision and Accuracy in Floating-Point Calculations
Visual C++ Programmer's Guide, under "Floating-Point Support".

↑ Back to the top


Keywords: KB263213, kbinfo, kbfloatpoint

↑ Back to the top

Article Info
Article ID : 263213
Revision : 7
Created on : 1/27/2007
Published on : 1/27/2007
Exists online : False
Views : 415