From e87b328791e099aa18789a3b7bd2a5903f2d1779 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Fri, 16 Oct 2026 10:26:48 +0000 Subject: [PATCH] test: migrate `constants/float32/ln-half` to ULP-based assertions Migrate the test suite for `constants/float32/ln-half` from a relative tolerance assertion to a ULP difference assertion. Ref: https://github.com/stdlib-js/stdlib/issues/11352 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_0145oPrciok5CLgLVy5bna7i --- .../constants/float32/ln-half/test/test.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/ln-half/test/test.js b/lib/node_modules/@stdlib/constants/float32/ln-half/test/test.js index 00856a1b2bd0..ba3470c0ee4a 100644 --- a/lib/node_modules/@stdlib/constants/float32/ln-half/test/test.js +++ b/lib/node_modules/@stdlib/constants/float32/ln-half/test/test.js @@ -22,8 +22,7 @@ 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/float32/eps' ); +var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var FLOAT32_LN_HALF = require( './../lib' ); @@ -41,15 +40,7 @@ tape( 'export is a single-precision floating-point number equal to `-0.693147182 }); tape( 'export equals `lnf(0.5)`', function test( t ) { - var delta; - var tol; - var v; - - v = lnf( 0.5 ); - delta = absf( v - FLOAT32_LN_HALF ); - tol = EPS; - - t.ok( delta <= tol, 'equals ln(0.5) within tolerance '+tol ); - + var v = lnf( 0.5 ); + t.strictEqual( isAlmostSameValue( v, FLOAT32_LN_HALF, 0 ), true, 'returns expected value' ); t.end(); });