From e8c3a2122b38acfb10a778b1f4382f214be2de1d Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Wed, 22 Apr 2026 11:03:50 +0000 Subject: [PATCH 1/4] ulp-bases testing --- .../math/base/special/binet/test/test.js | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/binet/test/test.js b/lib/node_modules/@stdlib/math/base/special/binet/test/test.js index f020a5bf9097..025878f70bd6 100644 --- a/lib/node_modules/@stdlib/math/base/special/binet/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/binet/test/test.js @@ -24,10 +24,9 @@ var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); -var EPS = require( '@stdlib/constants/float64/eps' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var fibonacci = require( '@stdlib/math/base/special/fibonacci' ); var negaFibonacci = require( '@stdlib/math/base/special/negafibonacci' ); -var abs = require( '@stdlib/math/base/special/abs' ); var binet = require( './../lib' ); @@ -59,8 +58,6 @@ tape( 'if provided `-infinity`, the function returns `NaN`', function test( t ) tape( 'for nonnegative integers, the function approximates the nth Fibonacci number', function test( t ) { var expected; - var delta; - var tol; var v; var i; for ( i = 0; i < 79; i++ ) { @@ -69,9 +66,11 @@ tape( 'for nonnegative integers, the function approximates the nth Fibonacci num if ( v === expected ) { t.strictEqual( v, expected, 'returns the '+i+'th Fibonacci number' ); } else { - delta = abs( v - expected ); - tol = 13.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'returns approximation. n: '+i+'. expected: '+expected+'. actual: '+v+'. Δ: '+delta+'. tol: '+tol+'.' ); + t.strictEqual( + isAlmostSameValue( v, expected, 24 ), + true, + 'returns expected value' + ); } } t.end(); @@ -79,8 +78,6 @@ tape( 'for nonnegative integers, the function approximates the nth Fibonacci num tape( 'for nonpositive integers, the function approximates the nth negaFibonacci number', function test( t ) { var expected; - var delta; - var tol; var v; var i; for ( i = 0; i > -79; i-- ) { @@ -89,9 +86,11 @@ tape( 'for nonpositive integers, the function approximates the nth negaFibonacci if ( v === expected ) { t.strictEqual( v, expected, 'returns the '+i+'th negaFibonacci number' ); } else { - delta = abs( v - expected ); - tol = 12.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'returns approximation. n: '+i+'. expected: '+expected+'. actual: '+v+'. Δ: '+delta+'. tol: '+tol+'.' ); + t.strictEqual( + isAlmostSameValue( v, expected, 24 ), + true, + 'returns expected value' + ); } } t.end(); From f58862396a66b0568053a30c8a8603ec81dd6ad8 Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Wed, 22 Apr 2026 11:12:13 +0000 Subject: [PATCH 2/4] test-file --- .../@stdlib/math/base/special/binet/test/test.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/binet/test/test.js b/lib/node_modules/@stdlib/math/base/special/binet/test/test.js index 025878f70bd6..4b2baa216551 100644 --- a/lib/node_modules/@stdlib/math/base/special/binet/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/binet/test/test.js @@ -66,11 +66,7 @@ tape( 'for nonnegative integers, the function approximates the nth Fibonacci num if ( v === expected ) { t.strictEqual( v, expected, 'returns the '+i+'th Fibonacci number' ); } else { - t.strictEqual( - isAlmostSameValue( v, expected, 24 ), - true, - 'returns expected value' - ); + t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); } } t.end(); @@ -86,11 +82,7 @@ tape( 'for nonpositive integers, the function approximates the nth negaFibonacci if ( v === expected ) { t.strictEqual( v, expected, 'returns the '+i+'th negaFibonacci number' ); } else { - t.strictEqual( - isAlmostSameValue( v, expected, 24 ), - true, - 'returns expected value' - ); + t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); } } t.end(); From 459d3d9cac1dc4cc756d06a31251080302ca60fc Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Fri, 24 Apr 2026 03:48:23 +0000 Subject: [PATCH 3/4] fixed the error --- .../@stdlib/math/base/special/binet/test/test.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/binet/test/test.js b/lib/node_modules/@stdlib/math/base/special/binet/test/test.js index 4b2baa216551..992836f2f920 100644 --- a/lib/node_modules/@stdlib/math/base/special/binet/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/binet/test/test.js @@ -63,27 +63,19 @@ tape( 'for nonnegative integers, the function approximates the nth Fibonacci num for ( i = 0; i < 79; i++ ) { v = binet( i ); expected = fibonacci( i ); - if ( v === expected ) { - t.strictEqual( v, expected, 'returns the '+i+'th Fibonacci number' ); - } else { - t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); } t.end(); }); -tape( 'for nonpositive integers, the function approximates the nth negaFibonacci number', function test( t ) { +tape( 'for nonpositive integers, the function approximates the nth negative Fibonacci number', function test( t ) { var expected; var v; var i; for ( i = 0; i > -79; i-- ) { v = binet( i ); expected = negaFibonacci( i ); - if ( v === expected ) { - t.strictEqual( v, expected, 'returns the '+i+'th negaFibonacci number' ); - } else { - t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); } t.end(); }); From 3747d9f9a0d655d8293090b822b5540db4387c3a Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 26 Apr 2026 05:14:35 -0700 Subject: [PATCH 4/4] test: fix description Signed-off-by: Athan --- lib/node_modules/@stdlib/math/base/special/binet/test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/binet/test/test.js b/lib/node_modules/@stdlib/math/base/special/binet/test/test.js index 992836f2f920..2e0c9aa0da78 100644 --- a/lib/node_modules/@stdlib/math/base/special/binet/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/binet/test/test.js @@ -68,7 +68,7 @@ tape( 'for nonnegative integers, the function approximates the nth Fibonacci num t.end(); }); -tape( 'for nonpositive integers, the function approximates the nth negative Fibonacci number', function test( t ) { +tape( 'for nonpositive integers, the function approximates the nth negafibonacci number', function test( t ) { var expected; var v; var i;