Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How You deal with VFP Rounding BUG
Message
 
To
23/11/2007 18:07:52
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01270811
Message ID:
01271007
Views:
26
Hi Vladimir,

> try above examples or rounding problems in VB or C# and they work like they should. So something is wrong with VFP definitely.

That's coincidence. Try this example in C# and you see that it doesn't work:
Console.Write( (Int32) (2.050000000000000043 * 100));
this will print 204 instead of 205. The reason you see a difference between the tools in your example has to do with the number of digits. .NET uses 15 significant digits, VFP uses 18. Your sample has the flipping digit at position 16. You get the same result as in C# when you change that number:
Set Fixed On
Set Decimals To 9
? 550000.8150000000000000000000000000
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform