PRB: Setting DECIMALS to 15 or More Produces Incorrect ResultID: Q131003 3.00 WINDOWS kbprg kbprb The information in this article applies to:
SYMPTOMSWhen you use SET DECIMAL to set DECIMAL to 15 or more, certain mathematical calculations produce an incorrect result.
CAUSESome numbers when represented in a floating point format have no exact representation. For example, this is 1/3 where as .33333333 is in fact slightly less than 1/3. However, some numbers that do have exact floating point representations still exhibit this behavior. See the "Steps to Reproduce Behavior" section for an example.
STATUSMicrosoft is researching this issue and will post new information here in the Microsoft Knowledge Base as it becomes available.
Steps to Reproduce Problem1. Launch Visual FoxPro. 2. In the Command window, enter the following, one line at a time:
3. Observe the results in the active output window. You should see
4. Repeat step 2, but this time set decimals to 15.
5. Observe the results. You should see 8.039999999999999. This is Additional reference words: 3.00 VFoxWin
KBCategory: kbprg kbprb
KBSubcategory: FxprgSet
|
Last Reviewed: May 1, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |