diff --git a/lib/node_modules/@stdlib/math/base/special/atan2/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/atan2/test/test.native.js index 4bdd9899b0e6..2f3a3db1f619 100755 --- a/lib/node_modules/@stdlib/math/base/special/atan2/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/atan2/test/test.native.js @@ -25,9 +25,8 @@ 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 isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var tryRequire = require( '@stdlib/utils/try-require' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var PI = require( '@stdlib/constants/float64/pi' ); @@ -196,8 +195,6 @@ tape( 'the function returns `-PI/2` if provided a negative `y` and `x=-0`', opts tape( 'the function evaluates the `atan2` function (when x and y are positive)', opts, function test( t ) { var expected; var actual; - var delta; - var tol; var x; var y; var i; @@ -207,9 +204,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 ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -217,8 +212,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)', opts, function test( t ) { var expected; var actual; - var delta; - var tol; var x; var y; var i; @@ -228,9 +221,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(); }); @@ -238,8 +229,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)', opts, function test( t ) { var expected; var actual; - var delta; - var tol; var x; var y; var i; @@ -249,9 +238,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(); });