I ran your script and received the right results:
2/3 - integer: 0.2,float: 0.666666666666667
However, I can see what you were expecting and you can only get that
using FLOAT.Divide.
Run this from a powerpro note. Hopefully this helps to see what a
modulus is (is the INTEGER remainder after the division...):
;XXXXXXXXX
debug
debug Float division
FOR(LOCAL i=0; i<8; i=i+1)
WIN.Debug(i++"/3=",i/3)
ENDFOR
debug
debug Modulus (is the INTEGER remainder after the division...)
FOR(LOCAL i=0; i<8; i=i+1)
WIN.Debug(i++"%3=",i%3)
ENDFOR
debug
debug Interger Division
FOR(LOCAL i=0; i<8; i=i+1)
WIN.Debug("float. divide "++i++"/3=",float.divide(i,3))
ENDFOR
QUIT
The above results are correct.
Ted
--- In [email protected], "davor_petric" wrote:
> Hi,
>
> It seems to me that the modulo (% - an integer reminder after a
> division) produces false results.situations, but wrong in some
> others.
> ...
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/