diff --git a/lib/node_modules/@stdlib/math/base/special/atan2d/test/test.js b/lib/node_modules/@stdlib/math/base/special/atan2d/test/test.js index dc453f49c516..203671413244 100644 --- a/lib/node_modules/@stdlib/math/base/special/atan2d/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/atan2d/test/test.js @@ -113,10 +113,17 @@ tape( 'the function returns `-135.0` if provided `x = y = -infinity`', function t.end(); }); -tape( 'the function returns `0.0` when `x = +infinity`', function test( t ) { - t.equal( atan2d( -2.0, PINF ), 0.0, 'returns expected value' ); - t.equal( atan2d( 0.0, PINF ), 0.0, 'returns expected value' ); - t.equal( atan2d( 2.0, PINF ), 0.0, 'returns expected value' ); +tape( 'the function returns `0.0` when `y > 0` and `x = +infinity`', function test( t ) { + t.equal( isPositiveZero( atan2d( 1.0, PINF ) ), true, 'returns expected value' ); + t.equal( isPositiveZero( atan2d( 2.0, PINF ) ), true, 'returns expected value' ); + t.equal( isPositiveZero( atan2d( 3.0, PINF ) ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `-0.0` when `y < 0` and `x = +infinity`', function test( t ) { + t.equal( isNegativeZero( atan2d( -1.0, PINF ) ), true, 'returns expected value' ); + t.equal( isNegativeZero( atan2d( -2.0, PINF ) ), true, 'returns expected value' ); + t.equal( isNegativeZero( atan2d( -3.0, PINF ) ), true, 'returns expected value' ); t.end(); }); @@ -155,13 +162,27 @@ tape( 'the function returns `90.0` if provided a positive `y` and `x=0`', functi t.end(); }); -tape( 'the function returns `90.0` if provided a negative `y` and `x=0`', function test( t ) { +tape( 'the function returns `90.0` if provided a positive `y` and `x=-0`', function test( t ) { + t.equal( atan2d( 2.0, -0.0 ), 90.0, 'returns expected value' ); + t.equal( atan2d( 1.0, -0.0 ), 90.0, 'returns expected value' ); + t.equal( atan2d( 0.5, -0.0 ), 90.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `-90.0` if provided a negative `y` and `x=0`', function test( t ) { t.equal( atan2d( -2.0, 0.0 ), -90.0, 'returns expected value' ); t.equal( atan2d( -1.0, 0.0 ), -90.0, 'returns expected value' ); t.equal( atan2d( -0.5, 0.0 ), -90.0, 'returns expected value' ); t.end(); }); +tape( 'the function returns `-90.0` if provided a negative `y` and `x=-0`', function test( t ) { + t.equal( atan2d( -2.0, -0.0 ), -90.0, 'returns expected value' ); + t.equal( atan2d( -1.0, -0.0 ), -90.0, 'returns expected value' ); + t.equal( atan2d( -0.5, -0.0 ), -90.0, 'returns expected value' ); + t.end(); +}); + tape( 'the function evaluates the `atan2d` function (when x and y are positive)', function test( t ) { var expected; var actual; diff --git a/lib/node_modules/@stdlib/math/base/special/atan2d/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/atan2d/test/test.native.js index 95fe93671576..f1412692121e 100755 --- a/lib/node_modules/@stdlib/math/base/special/atan2d/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/atan2d/test/test.native.js @@ -122,10 +122,17 @@ tape( 'the function returns `-135.0` if provided `x = y = -infinity`', opts, fun t.end(); }); -tape( 'the function returns `0.0` when `x = +infinity`', opts, function test( t ) { - t.equal( atan2d( -2.0, PINF ), 0.0, 'returns expected value' ); - t.equal( atan2d( 0.0, PINF ), 0.0, 'returns expected value' ); - t.equal( atan2d( 2.0, PINF ), 0.0, 'returns expected value' ); +tape( 'the function returns `0.0` when `y > 0` and `x = +infinity`', opts, function test( t ) { + t.equal( isPositiveZero( atan2d( 1.0, PINF ) ), true, 'returns expected value' ); + t.equal( isPositiveZero( atan2d( 2.0, PINF ) ), true, 'returns expected value' ); + t.equal( isPositiveZero( atan2d( 3.0, PINF ) ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `-0.0` when `y < 0` and `x = +infinity`', opts, function test( t ) { + t.equal( isNegativeZero( atan2d( -1.0, PINF ) ), true, 'returns expected value' ); + t.equal( isNegativeZero( atan2d( -2.0, PINF ) ), true, 'returns expected value' ); + t.equal( isNegativeZero( atan2d( -3.0, PINF ) ), true, 'returns expected value' ); t.end(); }); @@ -164,13 +171,27 @@ tape( 'the function returns `90.0` if provided a positive `y` and `x=0`', opts, t.end(); }); -tape( 'the function returns `90.0` if provided a negative `y` and `x=0`', opts, function test( t ) { +tape( 'the function returns `90.0` if provided a positive `y` and `x=-0`', opts, function test( t ) { + t.equal( atan2d( 2.0, -0.0 ), 90.0, 'returns expected value' ); + t.equal( atan2d( 1.0, -0.0 ), 90.0, 'returns expected value' ); + t.equal( atan2d( 0.5, -0.0 ), 90.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `-90.0` if provided a negative `y` and `x=0`', opts, function test( t ) { t.equal( atan2d( -2.0, 0.0 ), -90.0, 'returns expected value' ); t.equal( atan2d( -1.0, 0.0 ), -90.0, 'returns expected value' ); t.equal( atan2d( -0.5, 0.0 ), -90.0, 'returns expected value' ); t.end(); }); +tape( 'the function returns `-90.0` if provided a negative `y` and `x=-0`', opts, function test( t ) { + t.equal( atan2d( -2.0, -0.0 ), -90.0, 'returns expected value' ); + t.equal( atan2d( -1.0, -0.0 ), -90.0, 'returns expected value' ); + t.equal( atan2d( -0.5, -0.0 ), -90.0, 'returns expected value' ); + t.end(); +}); + tape( 'the function evaluates the `atan2d` function (when x and y are positive)', opts, function test( t ) { var expected; var actual;