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 @@ -231,6 +231,22 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
t.end();
});

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

x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
out = new Float64Array( 2 );
v = dnannsumkbn2( x.length, x, 0, out, 1 );

expected = new Float64Array( [ 0.0, 0.0 ] );
t.deepEqual( v, expected, 'returns expected value' );

t.end();
});

tape( 'the function supports view offsets', function test( t ) {
var expected0;
var expected1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,22 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
t.end();
});

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

x = new Float64Array( [ NaN, 1.0, 2.0, 3.0 ] );
out = new Float64Array( 2 );
v = dnannsumkbn2( x.length, x, 0, out, 1 );

expected = new Float64Array( [ 0.0, 0.0 ] );
t.deepEqual( v, expected, 'returns expected value' );

t.end();
});

tape( 'the function supports view offsets', opts, function test( t ) {
var expected0;
var expected1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,22 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
t.end();
});

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

x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
out = new Float64Array( 2 );
v = dnannsumkbn2( x.length, x, 0, 0, out, 1, 0 );

expected = new Float64Array( [ 0.0, 0.0 ] );
t.deepEqual( v, expected, 'returns expected value' );

t.end();
});

tape( 'the function supports `offset` parameters', function test( t ) {
var expected;
var out;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,22 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
t.end();
});

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

x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
out = new Float64Array( 2 );
v = dnannsumkbn2( x.length, x, 0, 0, out, 1, 0 );

expected = new Float64Array( [ 0.0, 0.0 ] );
t.deepEqual( v, expected, 'returns expected value' );

t.end();
});

tape( 'the function supports `offset` parameters', opts, function test( t ) {
var expected;
var out;
Expand Down