JS_GetPositiveInfinityValue 编辑
Retrieve a floating-point infinity as a value of type JS::Value
.
Syntax
// Added in SpiderMonkey 42
JS::Value
JS_GetPositiveInfinityValue(JSContext *cx);
JS::Value
JS_GetNegativeInfinityValue(JSContext *cx);
// Obsolete since SpiderMonkey 42
jsval
JS_GetPositiveInfinityValue(JSContext *cx);
jsval
JS_GetNegativeInfinityValue(JSContext *cx);
Name | Type | Description |
---|---|---|
cx | JSContext * | A context. |
Description
JS_GetPositiveInfinityValue
returns a JS::Value
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
- MXR ID Search for
JS_GetPositiveInfinityValue
- MXR ID Search for
JS_GetNegativeInfinityValue
JS_GetNaNValue
- bug 1184564 -- Changed jsval to JS::Value
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论