is "MOD" the only option in Blitz?
Blitz3D Forums/Blitz3D Beginners Area/is "MOD" the only option in Blitz?
| ||
mates, when you want to perform division of numbers in Blitz3D (2D commands only) is MOD the only option??? |
| ||
when you want to perform division of numbers in Blitz3D (2D commands only) is MOD the only option??? Eh?Print 10/2???? |
| ||
yep, sorry. I thought Blitz had a dedicated division command of some kind. |
| ||
'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. |
| ||
if you want a faster alternative to MOD replace it with AND, but this won't work for floating point int's. |
| ||
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) |