Don't click here unless you want to be banned.

LSL Wiki : NaN

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are


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");}


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.

Q:What is the simplest way to make it so NaNs does not get an auto link?
A:Unfortunately, to put double-double quotes ("") around the phrase. I wish there was some better way :-/ -Chris

There is one comment on this page. [Display comments/form]