Skip to content

Commit b25bb8a

Browse files
committed
docs: update README with documentation for III_D macro
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent b6dc5e3 commit b25bb8a

File tree

1 file changed

+63
-0
lines changed
  • lib/node_modules/@stdlib/math/base/napi/ternary

1 file changed

+63
-0
lines changed

lib/node_modules/@stdlib/math/base/napi/ternary/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,69 @@ The function accepts the following arguments:
449449
void stdlib_math_base_napi_iid_d( napi_env env, napi_callback_info info, double (*fcn)( int32_t, int32_t, double ) );
450450
```
451451
452+
#### STDLIB_MATH_BASE_NAPI_MODULE_III_D( fcn )
453+
454+
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting three signed 32-bit integers and returning a double-precision floating-point number.
455+
456+
```c
457+
#include <stdint.h>
458+
459+
static double fcn( const int32_t x, const int32_t y, const int32_t z ) {
460+
// ...
461+
}
462+
463+
// ...
464+
465+
// Register a Node-API module:
466+
STDLIB_MATH_BASE_NAPI_MODULE_III_D( fcn );
467+
```
468+
469+
The macro expects the following arguments:
470+
471+
- **fcn**: `double (*fcn)( int32_t, int32_t, int32_t )` ternary function.
472+
473+
When used, this macro should be used **instead of** `NAPI_MODULE`. The macro includes `NAPI_MODULE`, thus ensuring Node-API module registration.
474+
475+
#### stdlib_math_base_napi_iii_d( env, info, fcn )
476+
477+
Invokes a ternary function accepting three signed 32-bit integers and returning a double-precision floating-point number.
478+
479+
```c
480+
#include <node_api.h>
481+
#include <stdint.h>
482+
483+
// ...
484+
485+
static double fcn( const int32_t x, const int32_t y, const int32_t z ) {
486+
// ...
487+
}
488+
489+
// ...
490+
491+
/**
492+
* Receives JavaScript callback invocation data.
493+
*
494+
* @param env environment under which the function is invoked
495+
* @param info callback data
496+
* @return Node-API value
497+
*/
498+
napi_value addon( napi_env env, napi_callback_info info ) {
499+
return stdlib_math_base_napi_iii_d( env, info, fcn );
500+
}
501+
502+
// ...
503+
```
504+
505+
The function accepts the following arguments:
506+
507+
- **env**: `[in] napi_env` environment under which the function is invoked.
508+
- **info**: `[in] napi_callback_info` callback data.
509+
- **fcn**: `[in] double (*fcn)( int32_t, int32_t, int32_t )` ternary function.
510+
511+
```c
512+
void stdlib_math_base_napi_iii_d( napi_env env, napi_callback_info info, double (*fcn)( int32_t, int32_t, int32_t ) );
513+
```
514+
452515
#### STDLIB_MATH_BASE_NAPI_MODULE_ZZZ_Z( fcn )
453516

454517
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting and returning double-precision complex floating-point numbers.

0 commit comments

Comments
 (0)