Skip to content

Commit 1deff7c

Browse files
committed
test: add comment on the use of approximate equality
--- 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 7d24f69 commit 1deff7c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ tape( 'the function evaluates the double factorial', function test( t ) {
9191
t.strictEqual( v, expected[ i ], 'returns expected value' );
9292
} else {
9393
delta = absf( v - expected[i] );
94+
95+
// NOTE: We use approximate equality because expected values from SciPy are computed using gamma function approximations instead of iterative single-precision computation.
9496
tol = 2.4 * EPS * absf( expected[i] );
9597
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. v: '+v+'. e: '+expected[i]+'. Δ: '+delta+'. tol: '+tol+'.' );
9698
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ tape( 'the function evaluates the double factorial', opts, function test( t ) {
8181
t.strictEqual( v, expected[ i ], 'returns expected value' );
8282
} else {
8383
delta = absf( v - expected[i] );
84+
85+
// NOTE: We use approximate equality because expected values from SciPy are computed using gamma function approximations instead of iterative single-precision computation.
8486
tol = 2.4 * EPS * absf( expected[i] );
8587
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. v: '+v+'. e: '+expected[i]+'. Δ: '+delta+'. tol: '+tol+'.' );
8688
}

0 commit comments

Comments
 (0)