Request: Integer Division
- Posted by SnakeCharmer Jan 02, 2013
- 1465 views
I offer to include integer division, for example:
integer Y = 3 integer Z = 2 integer X = Y \ Z
instead of
integer X = trunc(X/Z)
because it is more effective. First option is equivalent for
integer X = 0 while Y >= Z do X += 1 Y -= Z end while
Second option is equivalent for
integer Y = 3 integer Z = 2 atom YY = Y atom ZZ = Z atom XX = YY / ZZ integer X = trunc(XX)
As far as I know, integer addition and subtraction is much more effective than the division of floating point numbers.