Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How You deal with VFP Rounding BUG
Message
 
À
23/11/2007 18:07:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01270811
Message ID:
01271007
Vues:
25
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform