From 3b4a430ab7c4a4d0712ba9169bbdff2d0e13d74a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 09:10:24 +0000 Subject: [PATCH 1/2] test: migrate `constants/float64/ln-two-pi` to ULP-based assertions Ref: https://github.com/stdlib-js/stdlib/issues/11352 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0157PdQFGkHiseLjJiHZNFNP --- .../@stdlib/constants/float64/ln-two-pi/test/test.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float64/ln-two-pi/test/test.js b/lib/node_modules/@stdlib/constants/float64/ln-two-pi/test/test.js index 6adde11c1995..e16f33c364fc 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-two-pi/test/test.js +++ b/lib/node_modules/@stdlib/constants/float64/ln-two-pi/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 PI = require( '@stdlib/constants/float64/pi' ); var LN_TWO_PI = require( './../lib' ); @@ -42,15 +41,12 @@ tape( 'export is a double-precision floating-point number equal to `1.8378770664 }); tape( 'export equals `ln(2*pi)`', function test( t ) { - var delta; - var tol; + var ULP; var v; + ULP = 1; v = ln( 2.0*PI ); - delta = abs( v - LN_TWO_PI ); - tol = EPS * LN_TWO_PI; - - t.ok( delta <= tol, 'equals ln(2*pi) within tolerance '+tol ); + t.strictEqual( isAlmostSameValue( v, LN_TWO_PI, ULP ), true, 'returns expected value' ); t.end(); }); From 160a03f2434ae66e49b0b009fd9ea773671f4375 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 12 Oct 2026 15:23:17 +0200 Subject: [PATCH 2/2] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/constants/float64/ln-two-pi/test/test.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float64/ln-two-pi/test/test.js b/lib/node_modules/@stdlib/constants/float64/ln-two-pi/test/test.js index e16f33c364fc..ff471eef48a0 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-two-pi/test/test.js +++ b/lib/node_modules/@stdlib/constants/float64/ln-two-pi/test/test.js @@ -41,12 +41,10 @@ tape( 'export is a double-precision floating-point number equal to `1.8378770664 }); tape( 'export equals `ln(2*pi)`', function test( t ) { - var ULP; var v; - ULP = 1; v = ln( 2.0*PI ); - t.strictEqual( isAlmostSameValue( v, LN_TWO_PI, ULP ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValue( v, LN_TWO_PI, 1 ), true, 'returns expected value' ); t.end(); });