Skip to content

Commit a686017

Browse files
committed
test: increase the tolerance
--- 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 5739343 commit a686017

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,15 @@ tape( 'the function computes the cotangent of an angle measured in degrees (nega
7171

7272
for ( i = 0; i < x.length; i++ ) {
7373
y = cotd( x[i] );
74+
if ( expected[ i ] === null ) {
75+
t.equal( y, PINF, 'x: '+x[i]+'. E: '+expected[i] );
76+
continue;
77+
}
7478
if ( y === expected[ i ] ) {
7579
t.equal( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
7680
} else {
7781
delta = abs( y - expected[i] );
78-
tol = 1.4 * EPS * abs( expected[i] );
82+
tol = 2.0 * EPS * abs( expected[i] );
7983
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
8084
}
8185
}
@@ -95,11 +99,15 @@ tape( 'the function computes the cotangent of an angle measured in degrees (posi
9599

96100
for ( i = 0; i < x.length; i++ ) {
97101
y = cotd( x[i] );
102+
if ( expected[ i ] === null ) {
103+
t.equal( y, PINF, 'x: '+x[i]+'. E: '+expected[i] );
104+
continue;
105+
}
98106
if ( y === expected[ i ] ) {
99107
t.equal( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
100108
} else {
101109
delta = abs( y - expected[i] );
102-
tol = 1.4 * EPS * abs( expected[i] );
110+
tol = 2.0 * EPS * abs( expected[i] );
103111
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
104112
}
105113
}

0 commit comments

Comments
 (0)