Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INT(MOD(nNumber,2)) problem
Message
From
14/10/2002 17:07:49
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
 
 
To
14/10/2002 16:45:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00711105
Message ID:
00711129
Views:
9
>okay, thanks for the information anyway.

I get the same results as Sylvain (albeit VFP6 SP5 on W2K SP3). Most likely the values of your variable are not precisely 20 and 35 respectively. Bear in mind that floating point math is not exact (I believe VFP gives 15 sig figs) and that repeated/iterated calculations can cause unexpected errors to creep in.

You might be able to work around the problem by using the ROUND() or INT() function:
MOD(ROUND(lnchecktme1, 2), 2)
MOD(INT(lnchecktme1), 2)
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform