Skip to content

Commit 9315adc

Browse files
chore: updated input value and added float value
--- 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: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - 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: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - 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: passed - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: passed - 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 d850d1e commit 9315adc

File tree

10 files changed

+25
-24
lines changed

10 files changed

+25
-24
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,17 @@ console.log( v );
175175
### Usage
176176

177177
```c
178-
#include "stdlib/stats/base/dnanmeanpn.h"
178+
#include "stdlib/stats/base/snanmeanpn.h"
179179
```
180180

181-
#### stdlib_strided_dnanmeanpn( N, \*X, strideX )
181+
#### stdlib_strided_snanmeanpn( N, \*X, strideX )
182182

183183
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values and using a two-pass error correction algorithm.
184184

185185
```c
186-
const double x[] = { 1.0, -2.0, 0.0/0.0, 2.0 };
186+
const double x[] = { 1.0f, -2.0f, 0.0f/0.0f, 2.0f };
187187

188-
double v = stdlib_strided_dnanmeanpn( 4, x, 1 );
188+
double v = stdlib_strided_snanmeanpn( 4, x, 1 );
189189
// returns ~0.33333
190190
```
191191
@@ -196,17 +196,17 @@ The function accepts the following arguments:
196196
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
197197
198198
```c
199-
float stdlib_strided_dnanmeanpn( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
199+
float stdlib_strided_snanmeanpn( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
200200
```
201201

202-
#### stdlib_strided_dnanmeanpn_ndarray( N, \*X, strideX, offsetX )
202+
#### stdlib_strided_snanmeanpn_ndarray( N, \*X, strideX, offsetX )
203203

204204
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using a two-pass error correction algorithm and alternative indexing semantics.
205205

206206
```c
207-
const double x[] = { 1.0, -2.0, 0.0/0.0, 2.0 };
207+
const double x[] = { 1.0f, -2.0f, 0.0f/0.0f, 2.0f };
208208

209-
double v = stdlib_strided_dnanmeanpn_ndarray( 4, x, 1, 0 );
209+
double v = stdlib_strided_snanmeanpn_ndarray( 4, x, 1, 0 );
210210
// returns ~0.33333
211211
```
212212
@@ -218,7 +218,7 @@ The function accepts the following arguments:
218218
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
219219
220220
```c
221-
float stdlib_strided_dnanmeanpn_ndarray( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
221+
float stdlib_strided_snanmeanpn_ndarray( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
222222
```
223223

224224
</section>
@@ -245,7 +245,7 @@ float stdlib_strided_dnanmeanpn_ndarray( const CBLAS_INT N, const float *X, cons
245245

246246
int main( void ) {
247247
// Create a strided array:
248-
const float x[] = { 1.0, 2.0, 0.0/0.0, 3.0, 0.0/0.0, 4.0, 5.0, 6.0, 0.0/0.0, 7.0, 8.0, 0.0/0.0 };
248+
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 };
249249

250250
// Specify the number of elements:
251251
const int N = 6;

lib/node_modules/@stdlib/stats/base/snanmeanpn/benchmark/c/benchmark.length.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ static double benchmark1( int iterations, int len ) {
102102
int i;
103103

104104
for ( i = 0; i < len; i++ ) {
105-
if ( rand_float() < 0.2 ) {
106-
x[ i ] = 0.0 / 0.0; // NaN
105+
if ( rand_float() < 0.2f ) {
106+
x[ i ] = 0.0f / 0.0f; // NaN
107107
} else {
108-
x[ i ] = ( rand_float() * 20000.0 ) - 10000.0;
108+
x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f;
109109
}
110110
}
111111
v = 0.0f;

lib/node_modules/@stdlib/stats/base/snanmeanpn/docs/repl.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@
9191

9292
See Also
9393
--------
94+

lib/node_modules/@stdlib/stats/base/snanmeanpn/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
int main( void ) {
2323
// Create a strided array:
24-
const float x[] = { 1.0, 2.0, 0.0/0.0, 3.0, 0.0/0.0, 4.0, 5.0, 6.0, 0.0/0.0, 7.0, 8.0, 0.0/0.0 };
24+
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 };
2525

2626
// Specify the number of elements:
2727
const int N = 6;

lib/node_modules/@stdlib/stats/base/snanmeanpn/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
var uniform = require( '@stdlib/random/base/uniform' );
2222
var filledarrayBy = require( '@stdlib/array/filled-by' );
2323
var bernoulli = require( '@stdlib/random/base/bernoulli' );
24-
var snanmeanpn = require( '@stdlib/stats/base/snanmeanpn' );
24+
var snanmeanpn = require( './../lib' );
2525

2626
function rand() {
2727
if ( bernoulli( 0.8 ) < 1 ) {

lib/node_modules/@stdlib/stats/base/snanmeanpn/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
* var Float32Array = require( '@stdlib/array/float32' );
3737
* var snanmeanpn = require( '@stdlib/stats/base/snanmeanpn' );
3838
*
39-
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
39+
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
4040
*
41-
* var v = snanmeanpn.ndarray( 4, x, 2, 1 );
41+
* var v = snanmeanpn.ndarray( 5, x, 2, 1 );
4242
* // returns 1.25
4343
*/
4444

lib/node_modules/@stdlib/stats/base/snanmeanpn/lib/ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
4646
* @example
4747
* var Float32Array = require( '@stdlib/array/float32' );
4848
*
49-
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
49+
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
5050
*
51-
* var v = snanmeanpn( 4, x, 2, 1 );
51+
* var v = snanmeanpn( 5, x, 2, 1 );
5252
* // returns 1.25
5353
*/
5454
function snanmeanpn( N, x, strideX, offsetX ) {

lib/node_modules/@stdlib/stats/base/snanmeanpn/lib/ndarray.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ var addon = require( './../src/addon.node' );
3737
* @example
3838
* var Float32Array = require( '@stdlib/array/float32' );
3939
*
40-
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
40+
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
4141
*
42-
* var v = snanmeanpn( 4, x, 2, 1 );
42+
* var v = snanmeanpn( 5, x, 2, 1 );
4343
* // returns 1.25
4444
*/
4545
function snanmeanpn( N, x, strideX, offsetX ) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
3737
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
3838
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
3939
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
40-
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_snanmeanpn)( N, X, strideX ), v );
40+
STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(stdlib_strided_snanmeanpn)( N, X, strideX ), v );
4141
return v;
4242
}
4343

@@ -54,7 +54,7 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) {
5454
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
5555
STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 );
5656
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
57-
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_snanmeanpn_ndarray)( N, X, strideX, offsetX ), v );
57+
STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(stdlib_strided_snanmeanpn_ndarray)( N, X, strideX, offsetX ), v );
5858
return v;
5959
}
6060

lib/node_modules/@stdlib/stats/base/snanmeanpn/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ float API_SUFFIX(stdlib_strided_snanmeanpn_ndarray)( const CBLAS_INT N, const fl
6565
return 0.0f / 0.0f; // NaN
6666
}
6767
if ( N == 1 || strideX == 0 ) {
68-
return X[ 0 ];
68+
return X[ offsetX ];
6969
}
7070
ix = offsetX;
7171
o = ix;

0 commit comments

Comments
 (0)