Floating points - how is this possible?

Blitz3D Forums/Blitz3D Programming/Floating points - how is this possible?

There is probably a very logical explenation for this
Single precision floats aren't accurate and results will vary from PC to PC. I get 3.5 for the above.

Try this if you really need it restricted to 1 decimal place:
a#=15.6569
b#=12.1553
Print a#-b#
Print Round(a#-b#)
WaitKey
End

Function Round#(v#)
	return Float(Left$(Str$(v#),Instr(Str$(v#),".")+1))
End Function