contents   index   previous   next



NaN

The NaN type means "Not a Number". NaN is an acronym for the phrase. However, NaN does not have a literal representation. To test for NaN, the function, global.isNaN(), must be used, as illustrated in the following fragment:

 

var Test = "a string";

if (isNaN(parseInt(Test)))

   Screen.writeln("Test is Not a Number");

 

When the global.parseInt() function tries to parse the string "a string" into an integer, it returns NaN, since "a string" does not represent a number like the string "22" does.

 


Number constants