mozilla
Your Search Results

    JS_GetPositiveInfinityValue

    Retrieve a floating-point infinity as a value of type jsval.

    Syntax

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

    Description

    JS_GetPositiveInfinityValue returns a jsval that represents an IEEE floating-point positive infinity. JS_GetNegativeInfinityValue returns the corresponding negative infinity.

    Infinities are typically used to represent numbers that are greater in magnitude than the greatest representable finite values. As a value in mathematical calculations, an infinite value behaves like infinity. For example, any nonzero value multiplied by infinity is infinity with the expected sign, and any finite value divided by infinity is zero (again with the expected sign).

    To get a floating-point NaN, use JS_GetNaNValue.

    See Also

    Document Tags and Contributors

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