binary fractions (floats)

BlitzMax Forums/BlitzMax Programming/binary fractions (floats)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The best way to handle stuff like that is to use an epsilon value, ie:
Const EPSILON:Float = 0.001
Local a:Float = 6.0
Print "a is really: "+a
If Abs(a-6.0)<EPSILON
  Print "a=6.0"
ElseIf a-6.0<0.0
  Print "a<6.0"
Else
  Print "a>6.0"
EndIf
Incidentally "a is really 6.0" on my machine :)