Skip to content

Commit 35ecd7f

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 4fbdfd9 commit 35ecd7f

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
@@ -262,6 +262,46 @@ The function accepts the following arguments:
262262
void stdlib_math_base_napi_iid_d( napi_env env, napi_callback_info info, double (*fcn)( int32_t, int32_t, double ) );
263263
```
264264

265+
#### stdlib_math_base_napi_iii_d( env, info, fcn )
266+
267+
Invokes a ternary function accepting three signed 32-bit integers and returning a double-precision floating-point number.
268+
269+
```c
270+
#include <node_api.h>
271+
#include <stdint.h>
272+
273+
// ...
274+
275+
static double fcn( const int32_t x, const int32_t y, const int32_t z ) {
276+
// ...
277+
}
278+
279+
// ...
280+
281+
/**
282+
* Receives JavaScript callback invocation data.
283+
*
284+
* @param env environment under which the function is invoked
285+
* @param info callback data
286+
* @return Node-API value
287+
*/
288+
napi_value addon( napi_env env, napi_callback_info info ) {
289+
return stdlib_math_base_napi_iii_d( env, info, fcn );
290+
}
291+
292+
// ...
293+
```
294+
295+
The function accepts the following arguments:
296+
297+
- **env**: `[in] napi_env` environment under which the function is invoked.
298+
- **info**: `[in] napi_callback_info` callback data.
299+
- **fcn**: `[in] double (*fcn)( int32_t, int32_t, int32_t )` ternary function.
300+
301+
```c
302+
void stdlib_math_base_napi_iii_d( napi_env env, napi_callback_info info, double (*fcn)( int32_t, int32_t, int32_t ) );
303+
```
304+
265305
#### STDLIB_MATH_BASE_NAPI_MODULE_DDD_D( fcn )
266306

267307
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting and returning double-precision floating-point numbers.
@@ -350,6 +390,29 @@ The macro expects the following arguments:
350390

351391
When used, this macro should be used **instead of** `NAPI_MODULE`. The macro includes `NAPI_MODULE`, thus ensuring Node-API module registration.
352392

393+
#### STDLIB_MATH_BASE_NAPI_MODULE_III_D( fcn )
394+
395+
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.
396+
397+
```c
398+
#include <stdint.h>
399+
400+
static double fcn( const int32_t x, const int32_t y, const int32_t z ) {
401+
// ...
402+
}
403+
404+
// ...
405+
406+
// Register a Node-API module:
407+
STDLIB_MATH_BASE_NAPI_MODULE_III_D( fcn );
408+
```
409+
410+
The macro expects the following arguments:
411+
412+
- **fcn**: `double (*fcn)( int32_t, int32_t, int32_t )` ternary function.
413+
414+
When used, this macro should be used **instead of** `NAPI_MODULE`. The macro includes `NAPI_MODULE`, thus ensuring Node-API module registration.
415+
353416
</section>
354417
355418
<!-- /.usage -->

0 commit comments

Comments
 (0)