JavaScript-1.5 Reference

JS_GetNaNValue Function

Summary

Retrieves the numeric representation for not-a-number (NaN).

Syntax

jsval JS_GetNaNValue(JSContext *cx);

Description

JS_GetNanValue retrieves a numeric representation of NaN given a specific JS context, cx. JS_GetNaNValue returns a JS value that corresponds to the IEEE floating point quiet NaN value.

NaN is typically used in JavaScript to represent numbers that fall outside the valid range for integer or double values. NaN can also be used in error conditions to represent a numeric value that falls outside a prescribed programmatic range, such as an input value for a month variable that is not between 1 and 12.

Comparing NaN to any other numeric value or to itself always results in an unequal comparison.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_GetEmptyStringValue | JS_GetNegativeInfinityValue | JS_GetPositiveInfinityValue ]

This page was generated by APIDOC