Skip to content

Commit 2255c38

Browse files
committed
chore: minor clean-up
--- 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: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 2b98d7c commit 2255c38

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

lib/node_modules/@stdlib/stats/base/ndarray/dnanmskminabs/test/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var tape = require( 'tape' );
2424
var isnan = require( '@stdlib/math/base/assert/is-nan' );
25+
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
2526
var Float64Array = require( '@stdlib/array/float64' );
2627
var Uint8Array = require( '@stdlib/array/uint8' );
2728
var ndarray = require( '@stdlib/ndarray/base/ctor' );
@@ -77,7 +78,7 @@ tape( 'the function calculates the minimum absolute value of a one-dimensional n
7778
x = new Float64Array( [ -0.0, 0.0, NaN, -0.0 ] );
7879
mask = new Uint8Array( [ 0, 0, 0, 0 ] );
7980
v = dnanmskminabs( [ vector( 'float64', x, x.length, 1, 0 ), vector( 'uint8', mask, mask.length, 1, 0 ) ] );
80-
t.strictEqual( v, 0.0, 'returns expected value' );
81+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
8182

8283
x = new Float64Array( [ NaN ] );
8384
mask = new Uint8Array( [ 0 ] );

lib/node_modules/@stdlib/stats/base/ndarray/dnanstdevch/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ function createBenchmark( len ) {
8686
b.tic();
8787
for ( i = 0; i < b.iterations; i++ ) {
8888
v = dnanstdevch( [ x, correction ] );
89-
if ( isnan( v ) ) {
90-
b.fail( 'should not return NaN' );
89+
if ( typeof v !== 'number' ) {
90+
b.fail( 'should return a number' );
9191
}
9292
}
9393
b.toc();

lib/node_modules/@stdlib/stats/base/ndarray/snanmskminabs/test/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var tape = require( 'tape' );
2424
var Float32Array = require( '@stdlib/array/float32' );
2525
var Uint8Array = require( '@stdlib/array/uint8' );
2626
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
27+
var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );
2728
var ndarray = require( '@stdlib/ndarray/base/ctor' );
2829
var snanmskminabs = require( './../lib' );
2930

@@ -77,7 +78,7 @@ tape( 'the function calculates the minimum absolute value of a one-dimensional s
7778
x = new Float32Array( [ -0.0, 0.0, NaN, -0.0 ] );
7879
mask = new Uint8Array( [ 0, 0, 1, 0 ] );
7980
v = snanmskminabs( [ vector( 'float32', x, x.length, 1, 0 ), vector( 'uint8', mask, mask.length, 1, 0 ) ] );
80-
t.strictEqual( v, 0.0, 'returns expected value' );
81+
t.strictEqual( isPositiveZerof( v ), true, 'returns expected value' );
8182

8283
x = new Float32Array( [ -4.0, 0.0, NaN, 5.0 ] );
8384
mask = new Uint8Array( [ 0, 0, 0, 0 ] );

lib/node_modules/@stdlib/stats/strided/dnanmskmaxabs/lib/ndarray.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ function dnanmskmaxabs( N, x, strideX, offsetX, mask, strideMask, offsetMask ) {
7979
if ( mask[ im ] ) {
8080
continue;
8181
}
82-
v = abs( x[ ix ] );
82+
v = x[ ix ];
8383
if ( isnan( v ) ) {
8484
continue;
8585
}
86+
v = abs( v );
8687
if ( v > max ) {
8788
max = v;
8889
}

lib/node_modules/@stdlib/stats/strided/dnanmskmaxabs/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ double API_SUFFIX(stdlib_strided_dnanmskmaxabs_ndarray)( const CBLAS_INT N, cons
8282
if ( Mask[ im ] ) {
8383
continue;
8484
}
85-
v = stdlib_base_abs( X[ ix ] );
85+
v = X[ ix ];
8686
if ( stdlib_base_is_nan( v ) ) {
8787
continue;
8888
}
89+
v = stdlib_base_abs( v );
8990
if ( v > max ) {
9091
max = v;
9192
}

lib/node_modules/@stdlib/stats/strided/snanmskmaxabs/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ int main( void ) {
329329
330330
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
331331
332+
<!-- <related-links> -->
333+
334+
<!-- </related-links> -->
335+
332336
</section>
333337
334338
<!-- /.links -->

lib/node_modules/@stdlib/stats/strided/snanmskminabs/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The function has the following parameters:
6161
- **mask**: mask [`Uint8Array`][@stdlib/array/uint8]. If a `mask` array element is `0`, the corresponding element in `x` is considered valid and **included** in computation. If a `mask` array element is `1`, the corresponding element in `x` is considered invalid/missing and **excluded** from computation.
6262
- **strideMask**: stride length for `mask`.
6363

64-
The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`,
64+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`,
6565

6666
```javascript
6767
var Float32Array = require( '@stdlib/array/float32' );
@@ -329,6 +329,10 @@ int main( void ) {
329329
330330
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
331331
332+
<!-- <related-links> -->
333+
334+
<!-- </related-links> -->
335+
332336
</section>
333337
334338
<!-- /.links -->

0 commit comments

Comments
 (0)