Skip to content

Commit

Permalink
fix: apply review suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Snehil Shah <[email protected]>
  • Loading branch information
Snehil-Shah committed Dec 7, 2024
1 parent 3897f2a commit a2225c2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function snansumpw( N, x, strideX, offsetX ) {
}
ix = offsetX;
if ( strideX === 0 ) {
if ( isnanf( x[ offsetX ] ) ) {
if ( isnanf( x[ ix ] ) ) {
return 0.0;
}
return N * x[ ix ];
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/ext/base/snansumpw/src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(stdlib_strided_snansumpw)( N, X, strideX ), v )
STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(stdlib_strided_snansumpw)( N, X, strideX ), v );
return v;
}

Expand All @@ -54,7 +54,7 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(stdlib_strided_snansumpw_ndarray)( N, X, strideX, offsetX ), v )
STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(stdlib_strided_snansumpw_ndarray)( N, X, strideX, offsetX ), v );
return v;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/ext/base/snansumpw/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ float API_SUFFIX(stdlib_strided_snansumpw_ndarray)( const CBLAS_INT N, const flo
}
ix = offsetX;
if ( strideX == 0 ) {
if ( stdlib_base_is_nanf( X[ 0 ] ) ) {
if ( stdlib_base_is_nanf( X[ ix ] ) ) {
return 0.0f;
}
return N * X[ ix ];
Expand Down Expand Up @@ -135,7 +135,7 @@ float API_SUFFIX(stdlib_strided_snansumpw_ndarray)( const CBLAS_INT N, const flo
ix += strideX;
}
// Pairwise sum the accumulators:
sum = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));
sum = ( (s0+s1) + (s2+s3) ) + ( (s4+s5) + (s6+s7) );

// Clean-up loop...
for (; i < N; i++ ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tape( 'main export is a function', function test( t ) {
});

tape( 'the function has an arity of 3', function test( t ) {
t.strictEqual( snansumpw.length, 3, 'return expected value' );
t.strictEqual( snansumpw.length, 3, 'returns expected value' );
t.end();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tape( 'main export is a function', opts, function test( t ) {
});

tape( 'the function has an arity of 3', opts, function test( t ) {
t.strictEqual( snansumpw.length, 3, 'return expected value' );
t.strictEqual( snansumpw.length, 3, 'returns expected value' );
t.end();
});

Expand Down

0 comments on commit a2225c2

Please sign in to comment.