You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invokes a ternary function accepting and returning double-precision floating-point numbers.
107
+
<!-- NOTE: keep in alphabetical order according to the suffix XXX_X -->
110
108
111
-
```c
112
-
#include<node_api.h>
109
+
#### STDLIB_MATH_BASE_NAPI_MODULE_DDD_D( fcn )
113
110
114
-
// ...
111
+
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting and returning double-precision floating-point numbers.
115
112
113
+
```c
116
114
staticdoubleadd( const double x, const double y, const double z ) {
117
115
return x + y + z;
118
116
}
119
117
120
118
// ...
121
119
122
-
/**
123
-
* Receives JavaScript callback invocation data.
124
-
*
125
-
*@param env environment under which the function is invoked
126
-
*@param info callback data
127
-
*@return Node-API value
128
-
*/
129
-
napi_value addon( napi_env env, napi_callback_info info ) {
Invokes a ternary function accepting a double-precision floating-point number and two signed 32-bit integers and returning a double-precision floating-point number.
171
+
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting a double-precision floating-point number and two signed 32-bit integers and returning a double-precision floating-point number.
188
172
189
173
```c
190
-
#include<node_api.h>
191
174
#include <stdint.h>
192
175
193
-
// ...
194
-
195
176
static double fcn( const double x, const int32_t y, const int32_t z ) {
196
177
// ...
197
178
}
198
179
199
180
// ...
200
181
201
-
/**
202
-
* Receives JavaScript callback invocation data.
203
-
*
204
-
*@param env environment under which the function is invoked
205
-
*@param info callback data
206
-
*@return Node-API value
207
-
*/
208
-
napi_value addon( napi_env env, napi_callback_info info ) {
Invokes a ternary function accepting two signed 32-bit integers and a double-precision floating-point number and returning a double-precision floating-point number.
194
+
Invokes a ternary function accepting a double-precision floating-point number and two signed 32-bit integers and returning a double-precision floating-point number.
228
195
229
196
```c
230
197
#include<node_api.h>
231
198
#include<stdint.h>
232
199
233
200
// ...
234
201
235
-
staticdoublefcn( const int32_t x, const int32_t y, const double z ) {
202
+
staticdoublefcn( const double x, const int32_t y, const int32_t z ) {
236
203
// ...
237
204
}
238
205
@@ -246,7 +213,7 @@ static double fcn( const int32_t x, const int32_t y, const double z ) {
246
213
*@return Node-API value
247
214
*/
248
215
napi_value addon( napi_env env, napi_callback_info info ) {
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting and returning double-precision floating-point numbers.
234
+
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting and returning single-precision floating-point numbers.
268
235
269
236
```c
270
-
staticdoubleadd( const double x, const double y, const double z ) {
237
+
staticfloataddf( const float x, const float y, const float z ) {
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting and returning single-precision floating-point numbers.
255
+
Invokes a ternary function accepting and returning single-precision floating-point numbers.
289
256
290
257
```c
258
+
#include <node_api.h>
259
+
260
+
// ...
261
+
291
262
static float addf( const float x, const float y, const float z ) {
292
263
return x + y + z;
293
264
}
294
265
295
266
// ...
296
267
297
-
// Register a Node-API module:
298
-
STDLIB_MATH_BASE_NAPI_MODULE_FFF_F( addf );
268
+
/**
269
+
* Receives JavaScript callback invocation data.
270
+
*
271
+
* @param env environment under which the function is invoked
272
+
* @param info callback data
273
+
* @return Node-API value
274
+
*/
275
+
napi_value addon( napi_env env, napi_callback_info info ) {
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting a double-precision floating-point number and two signed 32-bit integers and returning a double-precision floating-point number.
294
+
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting two signed 32-bit integers and a double-precision floating-point number and returning a double-precision floating-point number.
310
295
311
296
```c
312
297
#include <stdint.h>
313
298
314
-
staticdoublefcn( const double x, const int32_t y, const int32_t z ) {
299
+
static double fcn( const int32_t x, const int32_t y, const double z ) {
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting two signed 32-bit integers and a double-precision floating-point number and returning a double-precision floating-point number.
317
+
Invokes a ternary function accepting two signed 32-bit integers and a double-precision floating-point number and returning a double-precision floating-point number.
333
318
334
319
```c
320
+
#include<node_api.h>
335
321
#include<stdint.h>
336
322
323
+
// ...
324
+
337
325
staticdoublefcn( const int32_t x, const int32_t y, const double z ) {
338
326
// ...
339
327
}
340
328
341
329
// ...
342
330
343
-
// Register a Node-API module:
344
-
STDLIB_MATH_BASE_NAPI_MODULE_IID_D( fcn );
331
+
/**
332
+
* Receives JavaScript callback invocation data.
333
+
*
334
+
*@param env environment under which the function is invoked
335
+
*@param info callback data
336
+
*@return Node-API value
337
+
*/
338
+
napi_value addon( napi_env env, napi_callback_info info ) {
0 commit comments