Skip to content
Closed
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 @@ -119,6 +119,17 @@ 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 , 1.0,2.0,3.0,4.0]);

v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
t.end();
});

Comment on lines +122 to +132
Copy link
Member

@headlessNode headlessNode Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 , 1.0,2.0,3.0,4.0]);
v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
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, 1.0, 2.0, 3.0, 4.0 ] );
v = dnannsumkbn( x.length, x, 0 );
t.strictEqual( v, 0.0, 'returns expected Value' );
t.end();
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to adhere to the Style conventions. You can find them here: https://github.com/stdlib-js/stdlib/tree/develop/docs/style-guides

tape( 'if provided an `N` parameter less than or equal to `0`, the function returns a sum equal to `0.0`', function test( t ) {
var expected;
var out;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,17 @@ tape( 'the function supports negative `stride` parameters', opts, function test(
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 , 1.0,2.0,3.0,4.0]);

v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
t.end();
});

Comment on lines +227 to +237
Copy link
Member

@headlessNode headlessNode Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 , 1.0,2.0,3.0,4.0]);
v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
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, 1.0, 2.0, 3.0, 4.0 ] );
v = dnannsumkbn( x.length, x, 0 );
t.strictEqual( v, 0.0, 'returns expected Value' );
t.end();
});

tape( 'if provided a `stride` parameter equal to `0`, the function returns a sum equal to the first element', opts, function test( t ) {
var expected;
var out;
Expand Down
11 changes: 11 additions & 0 deletions lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ tape( 'if a native implementation is available, the main export is the native im
}
});

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 , 1.0,2.0,3.0,4.0]);

v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
t.end();
});

Comment on lines +66 to +76
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add it to the test.js file.

Suggested change
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 , 1.0,2.0,3.0,4.0]);
v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
t.end();
});

tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) {
var dnannsumkbn;
var main;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
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 , 1.0,2.0,3.0,4.0]);

v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
t.end();
});

Comment on lines +162 to +172
Copy link
Member

@headlessNode headlessNode Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 , 1.0,2.0,3.0,4.0]);
v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
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, 1.0, 2.0, 3.0, 4.0 ] );
v = dnannsumkbn( x.length, x, 0, 0 );
t.strictEqual( v, 0.0, 'returns expected Value' );
t.end();
});

tape( 'the function supports a `stride` parameter', function test( t ) {
var expected;
var out;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ 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 , 1.0,2.0,3.0,4.0]);

v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
t.end();
});

Comment on lines +131 to +141
Copy link
Member

@headlessNode headlessNode Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 , 1.0,2.0,3.0,4.0]);
v =dnannsumkbn(x.length, x ,0);
t.strictEqual(v,0.0, 'returns expected Value');
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, 1.0, 2.0, 3.0, 4.0 ] );
v = dnannsumkbn( x.length, x, 0, 0 );
t.strictEqual( v, 0.0, 'returns expected Value' );
t.end();
});

Copy link
Member Author

@Neerajpathak07 Neerajpathak07 Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will definitely look into the changes and create a pr again after changing the title.

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