Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding problem?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00348122
Message ID:
00348814
Views:
28
>>The question isn't whether or not it's a bug, but where it's coming from. VFP? or FPU?
>
>This bug is documented in KB # Q157954 - "BUG: ROUND() Function Not Rounding Properly After Calculations". Unfortunately the article doesn't divulge exactly what conditions cause it to happen, it just says that "For some numeric values, the precision limit within FoxPro decreases after performing mathematical calculations."

Thanks for the heads up, Rick. I do feel that I should point out that this is actually a problem within the expression parser, and not within the function itself. The title of the article is a bit misleading. I should also point out, that the article mentions a workaround (using the currency type). I've tried using both floats and doubles within VFP 6.0 SP3, and can confirm that the problem still exists.

>I think you may be on to something when you found that the difference starts to show up at 12 digits (in your TRANSFORM example). The value of SET DECIMALS has an effect which also kicks in at 12 - see my reply to David Stevenson elsewhere in this thread.

Perhaps, I'm just glad that this turns out to be a known issue. It might be tied somehow to the loose typing VFP allows, but can't say for certain.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform