Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where currency can play an ugly joke
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00986817
Message ID:
00987306
Vues:
52
>Fabio,
>
>>David, not mixed potatoes with tomatoes, please.
>
>That's exactly what you were doing. I was merely pointing out that one needs to understand where binary representation conversions are taking place and how those conversions affect the overall result. Since 1 / 3 is an infinitely repeating decimal value, and we don't have infinite bits to store it, there will be round off errors.
>
>It's a fact of life on binary computers, it doesn't do you any good to gripe about it every month or so.
>
>>On VFP the issue happen when the multiplication is done,
>>and VFP do a implicit conversion IEEE float to currency.
>>On SQL is the division of two integer that return a integer zero,
>>and none conversion is done.

You know, I'm not sure you could do the steps in question in C++ and get the correct answer either. As you said, it's a fact of working this way. As a matter of fact, the only reason a calculator would not show this problem is because on most calculators there is no way to imput 1/3, you must enter an approximation, which if you put the same one in twice would probably work depending on how deep you went in your approximation.
Cy Welch
Senior Programmer/Analyst
MetSYS Inc
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform