From 09371d43ef3c59b86ed4540118dae7ab917ca7ad Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Oct 2026 10:26:50 +0000 Subject: [PATCH 1/2] test: migrate `constants/float64/ln-two` to ULP-based assertions Migrate the `export equals ln(2)` test from a computed relative tolerance assertion to a ULP difference assertion using `@stdlib/assert/is-almost-same-value`. The ULP bound was tightened empirically to its measured minimum of `0`, as `ln( 2.0 )` is bit-identical to the exported constant. Ref: https://github.com/stdlib-js/stdlib/issues/11352 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01DtZG3ucwuUhUZ2vBb33zNr --- .../@stdlib/constants/float64/ln-two/test/test.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float64/ln-two/test/test.js b/lib/node_modules/@stdlib/constants/float64/ln-two/test/test.js index f28804029254..68af2f50c83e 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-two/test/test.js +++ b/lib/node_modules/@stdlib/constants/float64/ln-two/test/test.js @@ -21,9 +21,8 @@ // MODULES // var tape = require( 'tape' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var ln = require( '@stdlib/math/base/special/ln' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var LN2 = require( './../lib' ); @@ -41,15 +40,10 @@ tape( 'export is a double-precision floating-point number equal to `0.6931471805 }); tape( 'export equals `ln(2)`', function test( t ) { - var delta; - var tol; var v; v = ln( 2.0 ); - delta = abs( v - LN2 ); - tol = EPS * LN2; - - t.ok( delta <= tol, 'equals ln(2) within tolerance '+tol ); + t.strictEqual( isAlmostSameValue( v, LN2, 0 ), true, 'returns expected value' ); t.end(); }); From 260f6cf627d97c02e321095a1410c283b1a5e3ac Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 13 Oct 2026 12:54:16 +0200 Subject: [PATCH 2/2] style: remove whitespace Signed-off-by: Athan --- .../@stdlib/constants/float64/ln-two/test/test.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float64/ln-two/test/test.js b/lib/node_modules/@stdlib/constants/float64/ln-two/test/test.js index 68af2f50c83e..69792bc3720b 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-two/test/test.js +++ b/lib/node_modules/@stdlib/constants/float64/ln-two/test/test.js @@ -40,10 +40,7 @@ tape( 'export is a double-precision floating-point number equal to `0.6931471805 }); tape( 'export equals `ln(2)`', function test( t ) { - var v; - - v = ln( 2.0 ); + var v = ln( 2.0 ); t.strictEqual( isAlmostSameValue( v, LN2, 0 ), true, 'returns expected value' ); - t.end(); });