isnan_1.bmx 505 B

123456789101112131415161718
  1. SuperStrict
  2. For Local f:Float = - 0.4 Until 0.4 Step 0.2
  3. If IsInf(Log(f) ) Then
  4. Print "Log(" + f + ")=Infinity "+Log(f)
  5. Else If IsNan(Log(f) ) Then
  6. Print "Log(" + f + ") is not a real number "+Log(f)
  7. Else
  8. Print "Log(" + f + ")=" + Log(f)
  9. End If
  10. Next
  11. ' ===================
  12. ' Output
  13. ' Log(-0.400000006) is not a real number -1.#IND000000000000
  14. ' Log(-0.200000003) is not a real number -1.#IND000000000000
  15. ' Log(0.000000000)=Infinity -1.#INF000000000000
  16. ' Log(0.200000003)=-1.6094378975329393