Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not so logical
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01422244
Message ID:
01422764
Views:
76
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform