Division

Blitz3D Forums/Blitz3D Programming/Division

Look at it this way and you can see it's consistent:
a=-10
While Not KeyHit(1)
Print a+"/2     "+a/2
a=a+1
WaitKey
Wend


EDIT: Sorry, my original post's code was not actually very illustrative of the consistency - what's there now is better.

Anyway, to give an example: If you try 9/2 (which is 4.5) Blitz will return 4, which is rounded down. Well, if you round down -4.5 then you get -5. This accounts for the discrepancy you are seeing.