Skip to content

Commit 8afe308

Browse files
committed
Auto-generated commit
1 parent d0950e2 commit 8afe308

2 files changed

Lines changed: 5 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ A total of 96 issues were closed in this release:
731731

732732
<details>
733733

734+
- [`34e38bc`](https://github.com/stdlib-js/stdlib/commit/34e38bcc0c6ad6074c7b937f5e0e9efa56454c54) - **test:** migrate `math/base/special/binet` to ULP-based testing [(#11719)](https://github.com/stdlib-js/stdlib/pull/11719) _(by Mandeep2333, Athan Reines)_
734735
- [`2e347f3`](https://github.com/stdlib-js/stdlib/commit/2e347f39e4b36c5ed212ab6c35edd96ba412fe8d) - **test:** migrate `math/base/special/cabs2` to ULP-based testing [(#11760)](https://github.com/stdlib-js/stdlib/pull/11760) _(by Mandeep2333)_
735736
- [`06e1536`](https://github.com/stdlib-js/stdlib/commit/06e1536018d5db9ac1c1373e209501283042dcb1) - **test:** migrate `math/base/special/cabs` to ULP-based testing [(#11758)](https://github.com/stdlib-js/stdlib/pull/11758) _(by Mandeep2333)_
736737
- [`a02b852`](https://github.com/stdlib-js/stdlib/commit/a02b852b2e784220dba5ee181970e8ef3e921d2e) - **test:** migrate `math/base/special/betaln` to ULP-based testing [(#11717)](https://github.com/stdlib-js/stdlib/pull/11717) _(by Mandeep2333)_

base/special/binet/test/test.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ var tape = require( 'tape' );
2424
var isnan = require( './../../../../base/assert/is-nan' );
2525
var PINF = require( '@stdlib/constants/float64/pinf' );
2626
var NINF = require( '@stdlib/constants/float64/ninf' );
27-
var EPS = require( '@stdlib/constants/float64/eps' );
27+
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
2828
var fibonacci = require( './../../../../base/special/fibonacci' );
2929
var negaFibonacci = require( './../../../../base/special/negafibonacci' );
30-
var abs = require( './../../../../base/special/abs' );
3130
var binet = require( './../lib' );
3231

3332

@@ -59,40 +58,24 @@ tape( 'if provided `-infinity`, the function returns `NaN`', function test( t )
5958

6059
tape( 'for nonnegative integers, the function approximates the nth Fibonacci number', function test( t ) {
6160
var expected;
62-
var delta;
63-
var tol;
6461
var v;
6562
var i;
6663
for ( i = 0; i < 79; i++ ) {
6764
v = binet( i );
6865
expected = fibonacci( i );
69-
if ( v === expected ) {
70-
t.strictEqual( v, expected, 'returns the '+i+'th Fibonacci number' );
71-
} else {
72-
delta = abs( v - expected );
73-
tol = 13.0 * EPS * abs( expected );
74-
t.strictEqual( delta <= tol, true, 'returns approximation. n: '+i+'. expected: '+expected+'. actual: '+v+'. Δ: '+delta+'. tol: '+tol+'.' );
75-
}
66+
t.strictEqual( isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' );
7667
}
7768
t.end();
7869
});
7970

80-
tape( 'for nonpositive integers, the function approximates the nth negaFibonacci number', function test( t ) {
71+
tape( 'for nonpositive integers, the function approximates the nth negafibonacci number', function test( t ) {
8172
var expected;
82-
var delta;
83-
var tol;
8473
var v;
8574
var i;
8675
for ( i = 0; i > -79; i-- ) {
8776
v = binet( i );
8877
expected = negaFibonacci( i );
89-
if ( v === expected ) {
90-
t.strictEqual( v, expected, 'returns the '+i+'th negaFibonacci number' );
91-
} else {
92-
delta = abs( v - expected );
93-
tol = 12.0 * EPS * abs( expected );
94-
t.strictEqual( delta <= tol, true, 'returns approximation. n: '+i+'. expected: '+expected+'. actual: '+v+'. Δ: '+delta+'. tol: '+tol+'.' );
95-
}
78+
t.strictEqual( isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' );
9679
}
9780
t.end();
9881
});

0 commit comments

Comments
 (0)