diff --git a/lib/node_modules/@stdlib/math/base/special/atan2/test/test.js b/lib/node_modules/@stdlib/math/base/special/atan2/test/test.js index 25308b7f25cf..b40184637e9a 100644 --- a/lib/node_modules/@stdlib/math/base/special/atan2/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/atan2/test/test.js @@ -24,8 +24,7 @@ var tape = require( 'tape' ); 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 abs = require( '@stdlib/math/base/special/abs' ); -var EPS = require( '@stdlib/constants/float64/eps' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var PI = require( '@stdlib/constants/float64/pi' ); @@ -187,8 +186,6 @@ tape( 'the function returns `-PI/2` if provided a negative `y` and `x=-0`', func tape( 'the function evaluates the `atan2` function (when x and y are positive)', function test( t ) { var expected; var actual; - var delta; - var tol; var x; var y; var i; @@ -198,9 +195,7 @@ tape( 'the function evaluates the `atan2` function (when x and y are positive)', expected = positivePositive.expected; for ( i = 0; i < x.length; i++ ) { actual = atan2( y[i], x[i] ); - delta = abs( actual - expected[i] ); - tol = EPS * abs( expected[i] ); - t.strictEqual( delta <= tol, true, 'within tolerance. y: '+y[i]+'. x: '+x[i]+'. Actual: '+actual+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( actual, expected[ i ], 2 ), true, 'returns expected value' ); } t.end(); }); @@ -208,8 +203,6 @@ tape( 'the function evaluates the `atan2` function (when x and y are positive)', tape( 'the function evaluates the `atan2` function (when x is negative and y is positive)', function test( t ) { var expected; var actual; - var delta; - var tol; var x; var y; var i; @@ -219,9 +212,7 @@ tape( 'the function evaluates the `atan2` function (when x is negative and y is expected = negativePositive.expected; for ( i = 0; i < x.length; i++ ) { actual = atan2( y[i], x[i] ); - delta = abs( actual - expected[i] ); - tol = 2.0 * EPS * abs( expected[i] ); - t.strictEqual( delta <= tol, true, 'within tolerance. y: '+y[i]+'. x: '+x[i]+'. Actual: '+actual+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( actual, expected[ i ], 2 ), true, 'returns expected value' ); } t.end(); }); @@ -229,8 +220,6 @@ tape( 'the function evaluates the `atan2` function (when x is negative and y is tape( 'the function evaluates the `atan2` function (when x and y are negative)', function test( t ) { var expected; var actual; - var delta; - var tol; var x; var y; var i; @@ -240,9 +229,7 @@ tape( 'the function evaluates the `atan2` function (when x and y are negative)', expected = negativeNegative.expected; for ( i = 0; i < x.length; i++ ) { actual = atan2( y[i], x[i] ); - delta = abs( actual - expected[i] ); - tol = 2.0 * EPS * abs( expected[i] ); - t.strictEqual( delta <= tol, true, 'within tolerance. y: '+y[i]+'. x: '+x[i]+'. Actual: '+actual+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( actual, expected[ i ], 2 ), true, 'returns expected value' ); } t.end(); });