2020
2121// MODULES //
2222
23- var resolve = require ( 'path' ) . resolve ;
2423var tape = require ( 'tape' ) ;
2524var isnanf = require ( '@stdlib/math/base/assert/is-nanf' ) ;
2625var isNegativeZero = require ( '@stdlib/math/base/assert/is-negative-zero' ) ;
2726var isPositiveZero = require ( '@stdlib/math/base/assert/is-positive-zero' ) ;
2827var absf = require ( '@stdlib/math/base/special/absf' ) ;
29- var tryRequire = require ( '@stdlib/utils/try-require' ) ;
3028var EPS = require ( '@stdlib/constants/float32/eps' ) ;
3129var PINF = require ( '@stdlib/constants/float32/pinf' ) ;
3230var NINF = require ( '@stdlib/constants/float32/ninf' ) ;
31+ var PI02F = require ( '@stdlib/constants/float32/half-pi' ) ;
32+ var PI04F = require ( '@stdlib/constants/float32/fourth-pi' ) ;
3333var PI = require ( '@stdlib/constants/float32/pi' ) ;
3434
3535
@@ -50,7 +50,6 @@ var opts = {
5050
5151// TESTS //
5252
53-
5453tape ( 'main export is a function' , opts , function test ( t ) {
5554 t . ok ( true , __filename ) ;
5655 t . strictEqual ( typeof atan2f , 'function' , 'main export is a function' ) ;
@@ -87,11 +86,11 @@ tape( 'the function returns `-0` if provided `y = -0.0` and `x >= 0`', opts, fun
8786} ) ;
8887
8988tape ( 'the function returns `PI` if provided `y = +0.0` and `x <= -0.0`' , opts , function test ( t ) {
90- t . equal ( atan2f ( + 0.0 , - 0.0 ) , + PI , 'returns +PI' ) ;
91- t . equal ( atan2f ( + 0.0 , - 2.0 ) , + PI , 'returns +PI' ) ;
92- t . equal ( atan2f ( + 0.0 , - 4.0 ) , + PI , 'returns +PI' ) ;
93- t . equal ( atan2f ( + 0.0 , - 5.0 ) , + PI , 'returns +PI' ) ;
94- t . equal ( atan2f ( + 0.0 , - 10.0 ) , + PI , 'returns +PI' ) ;
89+ t . equal ( ( atan2f ( + 0.0 , - 0.0 ) ) , + PI , 'returns +PI' ) ;
90+ t . equal ( ( atan2f ( + 0.0 , - 2.0 ) ) , + PI , 'returns +PI' ) ;
91+ t . equal ( ( atan2f ( + 0.0 , - 4.0 ) ) , + PI , 'returns +PI' ) ;
92+ t . equal ( ( atan2f ( + 0.0 , - 5.0 ) ) , + PI , 'returns +PI' ) ;
93+ t . equal ( ( atan2f ( + 0.0 , - 10.0 ) ) , + PI , 'returns +PI' ) ;
9594 t . end ( ) ;
9695} ) ;
9796
@@ -105,22 +104,22 @@ tape( 'the function returns `-PI` if provided `y = -0.0` and `x <= -0.0`', opts,
105104} ) ;
106105
107106tape ( 'the function returns `+PI/4` if provided `x = y = +infinity`' , opts , function test ( t ) {
108- t . equal ( atan2f ( PINF , PINF ) , + PI / 4.0 , 'returns +PI/4' ) ;
107+ t . equal ( atan2f ( PINF , PINF ) , + PI04F , 'returns +PI/4' ) ;
109108 t . end ( ) ;
110109} ) ;
111110
112111tape ( 'the function returns `-PI/4` if provided `x = -y = +infinity`' , opts , function test ( t ) {
113- t . equal ( atan2f ( NINF , PINF ) , - PI / 4.0 , 'returns -PI/4' ) ;
112+ t . equal ( atan2f ( NINF , PINF ) , - PI04F , 'returns -PI/4' ) ;
114113 t . end ( ) ;
115114} ) ;
116115
117116tape ( 'the function returns `*3*PI/4` if provided `-x = y = +infinity`' , opts , function test ( t ) {
118- t . equal ( atan2f ( PINF , NINF ) , + 3.0 * PI / 4.0 , 'returns +3*PI/4' ) ;
117+ t . equal ( atan2f ( PINF , NINF ) , + 3.0 * PI04F , 'returns +3*PI/4' ) ;
119118 t . end ( ) ;
120119} ) ;
121120
122121tape ( 'the function returns `-3*PI/4` if provided `x = y = -infinity`' , opts , function test ( t ) {
123- t . equal ( atan2f ( NINF , NINF ) , - 3.0 * PI / 4.0 , 'returns -3*PI/4' ) ;
122+ t . equal ( atan2f ( NINF , NINF ) , - 3.0 * PI04F , 'returns -3*PI/4' ) ;
124123 t . end ( ) ;
125124} ) ;
126125
@@ -153,27 +152,27 @@ tape( 'the function returns `+PI/2` when `y = +infinity`', opts, function test(
153152} ) ;
154153
155154tape ( 'the function returns `-PI/2` when `y = -infinity`' , opts , function test ( t ) {
156- t . equal ( atan2f ( NINF , - 1.0 ) , - PI / 2.0 , 'returns -PI/2' ) ;
157- t . equal ( atan2f ( NINF , 0.0 ) , - PI / 2.0 , 'returns -PI/2' ) ;
158- t . equal ( atan2f ( NINF , 2.0 ) , - PI / 2.0 , 'returns -PI/2' ) ;
155+ t . equal ( atan2f ( NINF , - 1.0 ) , - PI02F , 'returns -PI/2' ) ;
156+ t . equal ( atan2f ( NINF , 0.0 ) , - PI02F , 'returns -PI/2' ) ;
157+ t . equal ( atan2f ( NINF , 2.0 ) , - PI02F , 'returns -PI/2' ) ;
159158 t . end ( ) ;
160159} ) ;
161160
162161tape ( 'the function returns `PI/2` if provided a positive `y` and `x=0`' , opts , function test ( t ) {
163- t . equal ( atan2f ( 2.0 , 0.0 ) , PI / 2.0 , 'returns PI/2' ) ;
164- t . equal ( atan2f ( 1.0 , 0.0 ) , PI / 2.0 , 'returns PI/2' ) ;
165- t . equal ( atan2f ( 0.5 , 0.0 ) , PI / 2.0 , 'returns PI/2' ) ;
162+ t . equal ( atan2f ( 2.0 , 0.0 ) , PI02F , 'returns PI/2' ) ;
163+ t . equal ( atan2f ( 1.0 , 0.0 ) , PI02F , 'returns PI/2' ) ;
164+ t . equal ( atan2f ( 0.5 , 0.0 ) , PI02F , 'returns PI/2' ) ;
166165 t . end ( ) ;
167166} ) ;
168167
169168tape ( 'the function returns `-PI/2` if provided a negative `y` and `x=0`' , opts , function test ( t ) {
170- t . equal ( atan2f ( - 2.0 , 0.0 ) , - PI / 2.0 , 'returns PI/2' ) ;
171- t . equal ( atan2f ( - 1.0 , 0.0 ) , - PI / 2.0 , 'returns PI/2' ) ;
172- t . equal ( atan2f ( - 0.5 , 0.0 ) , - PI / 2.0 , 'returns PI/2' ) ;
169+ t . equal ( atan2f ( - 2.0 , 0.0 ) , - PI02F , 'returns PI/2' ) ;
170+ t . equal ( atan2f ( - 1.0 , 0.0 ) , - PI02F , 'returns PI/2' ) ;
171+ t . equal ( atan2f ( - 0.5 , 0.0 ) , - PI02F , 'returns PI/2' ) ;
173172 t . end ( ) ;
174173} ) ;
175174
176- tape ( 'the function evaluates the `atan2 ` function (when x and y are positive)' , opts , function test ( t ) {
175+ tape ( 'the function evaluates the `atan2f ` function (when x and y are positive)' , opts , function test ( t ) {
177176 var expected ;
178177 var actual ;
179178 var delta ;
@@ -193,7 +192,7 @@ tape( 'the function evaluates the `atan2` function (when x and y are positive)',
193192 t . end ( ) ;
194193} ) ;
195194
196- tape ( 'the function evaluates the `atan2 ` function (when x is negative and y is positive)' , opts , function test ( t ) {
195+ tape ( 'the function evaluates the `atan2f ` function (when x is negative and y is positive)' , opts , function test ( t ) {
197196 var expected ;
198197 var actual ;
199198 var delta ;
@@ -213,7 +212,7 @@ tape( 'the function evaluates the `atan2` function (when x is negative and y is
213212 t . end ( ) ;
214213} ) ;
215214
216- tape ( 'the function evaluates the `atan2 ` function (when x and y are negative)' , opts , function test ( t ) {
215+ tape ( 'the function evaluates the `atan2f ` function (when x and y are negative)' , opts , function test ( t ) {
217216 var expected ;
218217 var actual ;
219218 var delta ;
0 commit comments