swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
      Other Library Functions  
function   is-nan    

Library: omfloat - floating point number support
Include: omfloat.xin
Return type: Boolean
Returns:       

A value of true when x is NaN; otherwise, a value of false.


Declaration

  define external switch function FP_isnan value float x


Purpose

Use is-nan to test a floating point number to determine if it is not a number (NaN). This function returns a switch value of true ("x" is NaN) or false. is-nan provides the only reliable means of determining whether a variable contains a NaN value.

The following "contrived" sample uses isnan to check for a value that is not a number (NaN). When such a value is found, the message "Error, result is not a number." is displayed.

  include "omfloat.xin"
  process
      local float x initial {3}
      local stream y initial {"A"}
      local float result
      set result to (x / y)

      do when is-nan result
          output "Error, result is not a number. %n"
          halt
      done
  ; Output: "Error, result is not a number."

        Other Library Functions
   constants in floating point
   FP_IsVersionCompatible
   FP_LibraryVersion
   is-nan
 
----  

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:07:25 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.