Function NaN#()
Return 0.0/a
End Function
Function Infinity#()
Return 1.0/a
End Function
Return 0.0/a
End Function
Function Infinity#()
Return 1.0/a
End Function
zero#=0.0 NaN#=zero#/zero# a#=3.14 if a# = NaN# print "a# is "+a#+" as well as NaN!" endif
zero#=0.0 Infinity#=1.0/zero a#=3.14 if a#>Infinity print "a# can now only be NaN!" endif
zero#=0 Infinity# = 1/zero ; alternatively Const Infinity# = 99999.0^99999.0 For i = 0 To 3 Select i Case 0 a#=Pi Case 1 a#=-(1/zero) Case 2 a#= (1/zero) Case 3 a#= zero/zero End Select If Abs(a#)>=Infinity Then ; test for NaN or Infinity Write "a# is "+a# ; To then determine the nature of the beast if this is important to you... If Abs(a#)<=Infinity Then ; this test will exclude NaN If a>0 Then Print " (Positive Infinity)" Else Print " (Negative Infinity)" EndIf Else Print " (Not a Number)" EndIf Else Print "a# is "+a#+" and good to go" EndIf Next WaitKey()