Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions lib/node_modules/@stdlib/math/base/special/binet/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
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' );


Expand Down Expand Up @@ -59,40 +58,24 @@

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++ ) {
v = binet( i );
expected = fibonacci( i );
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();
});

tape( 'for nonpositive integers, the function approximates the nth negaFibonacci number', function test( t ) {
tape( 'for nonpositive integers, the function approximates the nth negafibonacci number', function test( t ) {

Check warning on line 71 in lib/node_modules/@stdlib/math/base/special/binet/test/test.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "negafibonacci"
var expected;
var delta;
var tol;
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 {
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();
});