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
19 changes: 7 additions & 12 deletions lib/node_modules/@stdlib/stats/incr/nanmprod/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@
// MODULES //

var tape = require( 'tape' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var EPSILON = require( '@stdlib/constants/float64/eps' );
var isEven = require( '@stdlib/math/base/assert/is-even' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
var normal = require( '@stdlib/random/base/normal' );
var randu = require( '@stdlib/random/base/randu' );
var ldexp = require( '@stdlib/math/base/special/ldexp' );
var abs = require( '@stdlib/math/base/special/abs' );
var incrnanmprod = require( './../lib' );


Expand Down Expand Up @@ -190,8 +189,7 @@ tape( 'the accumulator function can return a result which overflows', function t

tape( 'overflow may be transient', function test( t ) {
var expected;
var delta;
var tol;
var actual;
var acc;
var x;
var y;
Expand All @@ -209,10 +207,9 @@ tape( 'overflow may be transient', function test( t ) {
acc( y );
acc( z );

delta = abs( expected - acc() );
tol = EPSILON * abs( expected );
actual = acc();

t.strictEqual( delta <= tol, true, 'within tolerance. Expected: '+expected+'. Actual: '+acc()+'. Delta: '+delta+'. Tol: '+tol+'.' );
t.strictEqual( isAlmostSameValue( actual, expected, 1 ), true, 'returns expected value' );
t.end();
});

Expand All @@ -228,8 +225,7 @@ tape( 'the accumulator function can return a result which underflows', function

tape( 'underflow may be transient', function test( t ) {
var expected;
var delta;
var tol;
var actual;
var acc;
var x;
var y;
Expand All @@ -250,10 +246,9 @@ tape( 'underflow may be transient', function test( t ) {

acc( z );

delta = abs( acc() - expected );
tol = EPSILON * abs( expected );
actual = acc();

t.strictEqual( delta <= tol, true, 'within tolerance. Expected: '+expected+'. Actual: '+acc()+'. Delta: '+delta+'. Tol: '+tol+'.' );
t.strictEqual( isAlmostSameValue( actual, expected, 1 ), true, 'returns expected value' );
t.end();
});

Expand Down