From 1811fc5282501b39d2c0a56c5de2fbd6f11ace54 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 02:23:59 +0000 Subject: [PATCH] test: migrate `constants/float16/ln-ten` to ULP-based assertions Replace the relative tolerance comparison in the `constants/float16/ln-ten` test suite with a ULP-based assertion using `@stdlib/number/float16/base/assert/is-almost-same-value`. The measured minimum ULP difference is zero, so the assertion uses `0` ULPs. Resolves a part of #11352 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01TtYau9K417VTv6oYzKnGzv --- 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: skipped - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - 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: na - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/constants/float16/ln-ten/test/test.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float16/ln-ten/test/test.js b/lib/node_modules/@stdlib/constants/float16/ln-ten/test/test.js index c9f720b733dc..83e6e0f80499 100644 --- a/lib/node_modules/@stdlib/constants/float16/ln-ten/test/test.js +++ b/lib/node_modules/@stdlib/constants/float16/ln-ten/test/test.js @@ -22,8 +22,8 @@ var tape = require( 'tape' ); var lnf = require( '@stdlib/math/base/special/lnf' ); -var absf = require( '@stdlib/math/base/special/absf' ); -var EPS = require( '@stdlib/constants/float16/eps' ); +var isAlmostSameValue = require( '@stdlib/number/float16/base/assert/is-almost-same-value' ); +var float64ToFloat16 = require( '@stdlib/number/float64/base/to-float16' ); var FLOAT16_LN10 = require( './../lib' ); @@ -41,14 +41,7 @@ tape( 'export is a half-precision floating-point number equal to `2.302734375`', }); tape( 'export equals `lnf(10)`', function test( t ) { - var delta; - var tol; - var v; - - v = lnf( 10.0 ); - delta = absf( v - FLOAT16_LN10 ); - tol = EPS * FLOAT16_LN10; - - t.ok( delta <= tol, 'equals lnf(10) within tolerance '+tol ); + var v = float64ToFloat16( lnf( 10.0 ) ); + t.strictEqual( isAlmostSameValue( v, FLOAT16_LN10, 0 ), true, 'returns expected value' ); t.end(); });