A B C D E F G I J K L M N O R S T U V W
Na No

NaN stands for Not a Number. NaNs are used to represent the results of operations that are not real numbers or are too big to fit into a float and therefore cannot be adequately represented with a float.

In SL, generating a NaN (by 1.0/0.0) will crash the script.

// Script run-time error - Math Error
foo(integer a, integer b)
{
    integer x=a/b;
    if( x==x ) {llSay(DEBUG_CHANNEL,"foo");}
}

default
{
    state_entry()
    {
        foo(1,0);
    }
}

 

NaNs in General

NaNs can behave quite differently among the many and varied implementations of computer-based arithmetic. For example, Java has special NaNs to represent positive infinity and negative infinity. NaNs can be represented by any one of a range of float bit patterns. Some implementations apply further meaning to individual NaN values, such as whether an exception should be raised when it is encountered in an operation.

See Wikipedia’s NaN entry.

 

Credit to: Lslwiki.net (not working) with changes made for brevity and clarity.