is "MOD" the only option in Blitz?

Blitz3D Forums/Blitz3D Beginners Area/is "MOD" the only option in Blitz?

Hansie(Posted 2003) [#1]
mates,

when you want to perform division of numbers in Blitz3D (2D commands only) is MOD the only option???


GfK(Posted 2003) [#2]
when you want to perform division of numbers in Blitz3D (2D commands only) is MOD the only option???
Eh?
Print 10/2
????


Hansie(Posted 2003) [#3]
yep, sorry. I thought Blitz had a dedicated division command of some kind.


FlameDuck(Posted 2003) [#4]
'Mod' isn't exactly a division as such, it's the Modulus, or more specificly the 'left over' bits of an Integer Division. A clever word for the '%' operator used in other languages.


injeevious(Posted 2003) [#5]
if you want a faster alternative to MOD replace it with AND, but this won't work for floating point int's.


Koriolis(Posted 2003) [#6]
And above all it works only if you mod the value with an integer that is a power of 2 (like x Mod 8 = x And 7)