Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ tape( 'the function calculates the sum of strided array elements (ignoring NaN v
t.end();
});

tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
var x;
var v;

x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );

v = dnansumkbn2( x.length, x, 0 );
t.strictEqual( v, 0.0, 'returns expected value' );

t.end();
});

tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', function test( t ) {
var x;
var v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ tape( 'the function calculates the sum of strided array elements (ignoring NaN v
t.end();
});

tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
var x;
var v;

x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );

v = dnansumkbn2( x.length, x, 0 );
t.strictEqual( v, 0.0, 'returns expected value' );

t.end();
});

tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', opts, function test( t ) {
var x;
var v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ tape( 'the function calculates the sum of strided array elements (ignoring NaN v
t.end();
});

tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
var x;
var v;

x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );

v = dnansumkbn2( x.length, x, 0, 0 );
t.strictEqual( v, 0.0, 'returns expected value' );

t.end();
});

tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', function test( t ) {
var x;
var v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ tape( 'the function calculates the sum of strided array elements (ignoring NaN v
t.end();
});

tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
var x;
var v;

x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );

v = dnansumkbn2( x.length, x, 0, 0 );
t.strictEqual( v, 0.0, 'returns expected value' );

t.end();
});

tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', opts, function test( t ) {
var x;
var v;
Expand Down
Loading