Request: Integer Division

new topic     » topic index » view thread      » older message » newer message

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.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu