Floats can also be used with case ranges. These can be expressed as float literals or float variable. Paradoxically, float variables are more efficient, because there is no direct way of loading a number literal or constant to the FPU.
This example also demonstrates how infinities, negative zero, and nans can be handled.
(nan means not a number)
float inf=1/0, nan=0/0, minf=-1/0, mzero=-0.0
float f
'f=.21
f=-1/0 'minus infinity
'f=-0.0
'f=0/0
select ?f
case ?mzero : print "minus 0.0"
case ?nan : print "nan"
case else
select f
case 0.0 to 0.1 : print "0.0 to 0.1 : " str f,2
case 0.1 to 0.2 : print "0.1 to 0.2 : " str f,2
case 0.2 to 0.3 : print "0.2 to 0.3 : " str f,2
case inf : print "infinity"
case minf : print "minus infinity"
end select
end select