Skip to content

Commit c645d4b

Browse files
committed
test: use strict equality for cosm1 within [-π/4,π/4] interval
--- 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: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 2c12d8c commit c645d4b

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

lib/node_modules/@stdlib/math/base/special/cosm1/test/test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ tape( 'main export is a function', function test( t ) {
5353

5454
tape( 'the function computes the cosine minus one more accurately inside the interval [-π/4,π/4]', function test( t ) {
5555
var expected;
56-
var delta;
57-
var tol;
5856
var x;
5957
var y;
6058
var i;
@@ -64,13 +62,7 @@ tape( 'the function computes the cosine minus one more accurately inside the int
6462

6563
for ( i = 0; i < x.length; i++ ) {
6664
y = cosm1( x[i] );
67-
if ( y === expected[ i ] ) {
68-
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
69-
} else {
70-
delta = abs( y - expected[i] );
71-
tol = 2.0 * EPS * abs( expected[i] );
72-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. Value: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
73-
}
65+
t.strictEqual( y, expected[ i ], 'returns expected value' );
7466
}
7567

7668
t.end();

lib/node_modules/@stdlib/math/base/special/cosm1/test/test.native.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ tape( 'main export is a function', opts, function test( t ) {
5858

5959
tape( 'the function computes the cosine minus one more accurately inside the interval [-π/4,π/4]', opts, function test( t ) {
6060
var expected;
61-
var delta;
62-
var tol;
6361
var x;
6462
var y;
6563
var i;
@@ -69,13 +67,7 @@ tape( 'the function computes the cosine minus one more accurately inside the int
6967

7068
for ( i = 0; i < x.length; i++ ) {
7169
y = cosm1( x[i] );
72-
if ( y === expected[ i ] ) {
73-
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
74-
} else {
75-
delta = abs( y - expected[i] );
76-
tol = 2.0 * EPS * abs( expected[i] );
77-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. Value: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
78-
}
70+
t.strictEqual( y, expected[ i ], 'returns expected value' );
7971
}
8072

8173
t.end();

0 commit comments

Comments
 (0)