Skip to content

Commit 480468a

Browse files
chore: minor clean up
1 parent 4e4dc46 commit 480468a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/node_modules/@stdlib/stats/base/dsnanmeanpn/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ console.log( v );
184184

185185
#### stdlib_strided_dsnanmeanpn( N, \*X, strideX )
186186

187-
Computes the arithmetic mean of a single-precision floating-point strided array `x` , ignoring `NaN` values, using a two-pass error correction algorithm with extended accumulation, and returning an extended precision result.
187+
Computes the arithmetic mean of a single-precision floating-point strided array , ignoring `NaN` values, using a two-pass error correction algorithm with extended accumulation, and returning an extended precision result.
188188

189189
```c
190190
const float x[] = { 1.0f, 2.0f, 0.0f/0.0f, 3.0f, 0.0f/0.0f, 4.0f, 5.0f, 6.0f, 0.0f/0.0f, 7.0f, 8.0f, 0.0f/0.0f };
191191

192192
double v = stdlib_strided_dsnanmeanpn( 6, x, 2 );
193-
// returns 4.66
193+
// returns 4.6667
194194
```
195195
196196
The function accepts the following arguments:
@@ -211,7 +211,7 @@ Computes the arithmetic mean of a single-precision floating-point strided array,
211211
const float x[] = { 1.0f, 2.0f, 0.0f/0.0f, 3.0f, 0.0f/0.0f, 4.0f, 5.0f, 6.0f, 0.0f/0.0f, 7.0f, 8.0f, 0.0f/0.0f };
212212

213213
double v = stdlib_strided_dsnanmeanpn_ndarray( 6, x, 2, 0 );
214-
// returns 4.66
214+
// returns 4.6667
215215
```
216216
217217
The function accepts the following arguments:

lib/node_modules/@stdlib/stats/base/dsnanmeanpn/src/addon.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "stdlib/napi/argv_int64.h"
2323
#include "stdlib/napi/argv_strided_float32array.h"
2424
#include "stdlib/napi/create_double.h"
25-
#include <node_api.h>
2625

2726
/**
2827
* Receives JavaScript callback invocation data.
@@ -36,7 +35,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
3635
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
3736
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
3837
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
39-
STDLIB_NAPI_CREATE_DOUBLE( env, (double)stdlib_strided_dsnanmeanpn( N, X, strideX ), v );
38+
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_dsnanmeanpn)( N, X, strideX ), v );
4039
return v;
4140
}
4241

@@ -53,7 +52,7 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) {
5352
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
5453
STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 );
5554
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
56-
STDLIB_NAPI_CREATE_DOUBLE( env, (double)stdlib_strided_dsnanmeanpn_ndarray( N, X, strideX, offsetX ), v );
55+
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_dsnanmeanpn_ndarray)( N, X, strideX, offsetX ), v );
5756
return v;
5857
}
5958

0 commit comments

Comments
 (0)