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
Macro for registering a Node-API module exporting an interface invoking a binary function accepting a double-precision complex floating-point number and a double-precision floating-point number and returning a double-precision complex floating-point number.
498
+
499
+
```c
500
+
#include "stdlib/complex/float64/ctor.h"
501
+
#include "stdlib/complex/float64/reim.h"
502
+
503
+
static stdlib_complex128_t mul( const double y, const stdlib_complex128_t x ) {
When used, this macro should be used **instead of**`NAPI_MODULE`. The macro includes `NAPI_MODULE`, thus ensuring Node-API module registration.
528
+
529
+
#### stdlib_math_base_napi_dz_z( env, info, fcn )
530
+
531
+
Invokes a binary function accepting a double-precision floating-point number and a double-precision complex floating-point number and returning a double-precision complex floating-point number.
532
+
533
+
```c
534
+
#include"stdlib/complex/float64/ctor.h"
535
+
#include"stdlib/complex/float64/reim.h"
536
+
#include<node_api.h>
537
+
538
+
// ...
539
+
540
+
staticstdlib_complex128_tmul( const double y, const stdlib_complex128_t x ) {
541
+
double xre;
542
+
double xim;
543
+
double re;
544
+
double im;
545
+
546
+
stdlib_complex128_reim( x, &xre, &xim );
547
+
548
+
re = xre * y;
549
+
im = xim * y;
550
+
551
+
return stdlib_complex128( re, im );
552
+
}
553
+
554
+
// ...
555
+
556
+
/**
557
+
* Receives JavaScript callback invocation data.
558
+
*
559
+
*@param env environment under which the function is invoked
560
+
*@param info callback data
561
+
*@return Node-API value
562
+
*/
563
+
napi_value addon( napi_env env, napi_callback_info info ) {
564
+
return stdlib_math_base_napi_dz_z( env, info, mul );
565
+
}
566
+
567
+
// ...
568
+
```
569
+
570
+
The function accepts the following arguments:
571
+
572
+
- **env**: `[in] napi_env` environment under which the function is invoked.
Macro for registering a Node-API module exporting an interface for invoking a binary function accepting and returning single-precision floating-point numbers.
0 commit comments