Skip to content

test: completes code coverage in blas/base/dnrm2 #6531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 14, 2025
Prev Previous commit
Next Next commit
fix: add decimals
Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com>
  • Loading branch information
ShabiShett07 authored Apr 4, 2025
commit 51912f37518683aa76d5def3e52402c8f946ceb8
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,22 @@ tape( 'the function calculates the L2-norm of a vector', opts, function test( t
z = dnrm2( x.length, x, 1, 0 );
t.strictEqual( z, 4.0, 'returns expected value' );

x = new Float64Array([ 1e150, 1e150, 1e150, 1e150 ]);
x = new Float64Array([ 1.0e150, 1.0e150, 1.0e150, 1.0e150 ]);

z = dnrm2( x.length, x, 1, 0 );
t.strictEqual( z, 2.0e+150, 'returns expected value' );

x = new Float64Array([ 1e-155, 1e-155, 1e-155, 1e-155 ]);
x = new Float64Array([ 1.0e-155, 1.0e-155, 1.0e-155, 1.0e-155 ]);

z = dnrm2( x.length, x, 1, 0 );
t.strictEqual( z, 2.0e-155, 'returns expected value' );

x = new Float64Array([ 1e150, 1e50, 1e150, 1e50 ]);
x = new Float64Array([ 1.0e150, 1.0e50, 1.0e150, 1.0e50 ]);

z = dnrm2( x.length, x, 1, 0 );
isApprox( t, z, 1.41421e150, 2.0 );

x = new Float64Array([ 1e-155, 1e50, 1e-155, 1e50 ]);
x = new Float64Array([ 1.0e-155, 1.0e50, 1.0e-155, 1.0e50 ]);

z = dnrm2( x.length, x, 1, 0 );
isApprox( t, z, 1.41421e50, 2.0 );
Expand Down