Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why not 1*(0.5-0.4-0.1) = 0?
Message
De
06/01/2005 18:55:24
 
 
À
06/01/2005 18:43:54
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Database:
MS SQL Server
Divers
Thread ID:
00974881
Message ID:
00974901
Vues:
40
>With ANY decimal numbers you will have some rounding errors. Sometimes the programs masks the error, and you get the result you want, and sometimes you get the wrong value, there's simply no way to avoid that. You can calculate with a million decimals and minimize the error, but you simply can not eliminate it. Everyone knows that (1/3)*3=1, but still all the calculators and programs I have seen shows 0.99999. In practice it's the same problem, it's only easier to see it.
>


now that one i can understand:

even though i agree that 3 thirds equal 1, but the conputer must work with 1/3 differently. it needs to break it down into 1:3 (as we write in germany), which comes out to 0.3333333 (endless).

now if you multiply this by 3 it will never be 1 - it should always be 0.9999999 (endless).


but i am sure some math-dude can explain exacly how this is. <s>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform