mozilla
Your Search Results

    JS_GetNaNValue

    Get the not-a-number (NaN) floating-point number as a value of type jsval.

    Syntax

    jsval
    JS_GetNaNValue(JSContext *cx);
    
    Name Type Description
    cx JSContext * A context.

    Description

    JS_GetNaNValue returns a value of type jsval that represents an IEEE floating-point quiet Not-a-Number (NaN).

    NaN is typically used in JavaScript as the return value of a numeric operation when an argument is invalid or conversion fails. For example, 0/0 and Math.sqrt(-1) both return NaN. So do Number("xyzzy") and Math.sin("Frank"). While the IEEE standard defines many NaN bit-patterns, they are indistinguishable in JavaScript, so in effect there's only one NaN.

    NaN is not equal to any other value. In fact, it is not even equal to itself: if x is NaN, then x != x.

    See Also

    Document Tags and Contributors

    Contributors to this page: fscholz, Nickolay, arai, MMondor, Tservo, Dria, Jorend
    Last updated by: arai,
    Hide Sidebar