napi_create_double


napi_status napi_create_double(napi_env env, double value, napi_value* result) 
  • [in] env:调用 API 的环境。

    ¥[in] env: The environment that the API is invoked under.

  • [in] value:要在 JavaScript 中表示的双精度值。

    ¥[in] value: Double-precision value to be represented in JavaScript.

  • [out] result:代表 JavaScript numbernapi_value

    ¥[out] result: A napi_value representing a JavaScript number.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

该 API 用于将 C double 类型转换为 JavaScript number 类型。

¥This API is used to convert from the C double type to the JavaScript number type.

JavaScript number 类型在 ECMAScript 语言规范的 第 6.1.6 节 中进行了描述。

¥The JavaScript number type is described in Section 6.1.6 of the ECMAScript Language Specification.