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
21 changes: 4 additions & 17 deletions lib/node_modules/@stdlib/math/base/special/atan2/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -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;
Expand All @@ -198,18 +195,14 @@ 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();
});

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;
Expand All @@ -219,18 +212,14 @@ 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();
});

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;
Expand All @@ -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();
});