Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not so logical
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01422244
Message ID:
01422764
Vues:
75
This message has been marked as a message which has helped to the initial question of the thread.
Hi Moises,

>Maybe INT() will work because this application does not require precision

This has absolutely nothing to with the precision needed by the application. As soon as your program performs operations other than addition or subtraction, you have to deal with fractions. As soon as you have fractions, you can have situations like the following:
? int(2.050000000000000044*100) && 205
? int(2.050000000000000043*100) && 204
Both values are clearly greater than 205. Yet, the second line will report 204. And that's entirely correct, because the integer part of the second line is 204. INT() is usually misused as a way to remove fractions, but that is NOT what INT() does. If you want to remove fractions, use ROUND(,0), always, ever! If you want to case a floating point to an integer use INT().
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform