JS_NumberValue 编辑
This article covers features introduced in SpiderMonkey 17
Convert a C floating-point number of type double
to a JS::Value
.
Replacement to JS_NewNumberValue
, JS_NewDoubleValue
, JS_NewDouble
.
Syntax
// Added in SpiderMonkey 42
JS::Value
JS_NumberValue(double d);
// Obsolete since SpiderMonkey 42
jsval
JS_NumberValue(double d);
Name | Type | Description |
---|---|---|
d | double | The numeric value to convert. |
Description
JS_NumberValue
converts a C floating-point number of type double
to JS::Value
, the type of JavaScript values.
The result is an integer JS::Value
if d
can be stored that way. Otherwise, a new floating-point JS::Value
is created.
See Also
- MXR ID Search for
JS_NumberValue
- bug 752223
- bug 1184564 -- Changed
jsval
toJS::Value
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论