What ??? A math bug in my BB2D ???

BlitzPlus Forums/BlitzPlus Programming/What ??? A math bug in my BB2D ???

Réno(Posted 2003) [#1]
Try this, it's a strange result, no ?

Print (1+(1/32))


( I've got the last update )


GfK(Posted 2003) [#2]
Haven't got Blitz2D installed but I get the same (correct) result in Blitz3D and BlitzPlus - "1".


WolRon(Posted 2003) [#3]
Umm, you didn't write what your result was. I get "1" (Blitz3D). Seems normal to me.


Beaker(Posted 2003) [#4]
1/32 is probably 0
1+0 is 1

If you change it to:
Print (1+(1.0/32))

You will get something more useful.


(tu) ENAY(Posted 2003) [#5]
Isn't it because you haven't defined any variable output types and since no decimal places are being used in the argument blitz automatically assumes the answer will be an int? So 1.03125 is stripped down to 1.


Réno(Posted 2003) [#6]
yes, you're right Enay, if there no float in argument, Blitz will consider it with an Int result.