Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INT(MOD(nNumber,2)) problem
Message
From
15/10/2002 08:20:10
 
 
To
14/10/2002 17:07:49
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00711105
Message ID:
00711266
Views:
8
this is true.
After many hours of working with this, before thinking of asking here, and then putting the service pack 5 on one of our machines to see if that was the problem, we finally found that the problem was not with that actual line, but a line where we convert CTOT() and then do addition and subtraction on the results.

Thanks for the help.

>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
Previous
Reply
Map
View

Click here to load this message in the networking platform