@@ -122,10 +122,17 @@ tape( 'the function returns `-135.0` if provided `x = y = -infinity`', opts, fun
122122 t . end ( ) ;
123123} ) ;
124124
125- tape ( 'the function returns `0.0` when `x = +infinity`' , opts , function test ( t ) {
126- t . equal ( atan2d ( - 2.0 , PINF ) , 0.0 , 'returns expected value' ) ;
127- t . equal ( atan2d ( 0.0 , PINF ) , 0.0 , 'returns expected value' ) ;
128- t . equal ( atan2d ( 2.0 , PINF ) , 0.0 , 'returns expected value' ) ;
125+ tape ( 'the function returns `0.0` when `y > 0` and `x = +infinity`' , opts , function test ( t ) {
126+ t . equal ( isPositiveZero ( atan2d ( 1.0 , PINF ) ) , true , 'returns expected value' ) ;
127+ t . equal ( isPositiveZero ( atan2d ( 2.0 , PINF ) ) , true , 'returns expected value' ) ;
128+ t . equal ( isPositiveZero ( atan2d ( 3.0 , PINF ) ) , true , 'returns expected value' ) ;
129+ t . end ( ) ;
130+ } ) ;
131+
132+ tape ( 'the function returns `-0.0` when `y < 0` and `x = +infinity`' , opts , function test ( t ) {
133+ t . equal ( isNegativeZero ( atan2d ( - 1.0 , PINF ) ) , true , 'returns expected value' ) ;
134+ t . equal ( isNegativeZero ( atan2d ( - 2.0 , PINF ) ) , true , 'returns expected value' ) ;
135+ t . equal ( isNegativeZero ( atan2d ( - 3.0 , PINF ) ) , true , 'returns expected value' ) ;
129136 t . end ( ) ;
130137} ) ;
131138
@@ -164,13 +171,27 @@ tape( 'the function returns `90.0` if provided a positive `y` and `x=0`', opts,
164171 t . end ( ) ;
165172} ) ;
166173
167- tape ( 'the function returns `90.0` if provided a negative `y` and `x=0`' , opts , function test ( t ) {
174+ tape ( 'the function returns `90.0` if provided a positive `y` and `x=-0`' , opts , function test ( t ) {
175+ t . equal ( atan2d ( 2.0 , - 0.0 ) , 90.0 , 'returns expected value' ) ;
176+ t . equal ( atan2d ( 1.0 , - 0.0 ) , 90.0 , 'returns expected value' ) ;
177+ t . equal ( atan2d ( 0.5 , - 0.0 ) , 90.0 , 'returns expected value' ) ;
178+ t . end ( ) ;
179+ } ) ;
180+
181+ tape ( 'the function returns `-90.0` if provided a negative `y` and `x=0`' , opts , function test ( t ) {
168182 t . equal ( atan2d ( - 2.0 , 0.0 ) , - 90.0 , 'returns expected value' ) ;
169183 t . equal ( atan2d ( - 1.0 , 0.0 ) , - 90.0 , 'returns expected value' ) ;
170184 t . equal ( atan2d ( - 0.5 , 0.0 ) , - 90.0 , 'returns expected value' ) ;
171185 t . end ( ) ;
172186} ) ;
173187
188+ tape ( 'the function returns `-90.0` if provided a negative `y` and `x=-0`' , opts , function test ( t ) {
189+ t . equal ( atan2d ( - 2.0 , - 0.0 ) , - 90.0 , 'returns expected value' ) ;
190+ t . equal ( atan2d ( - 1.0 , - 0.0 ) , - 90.0 , 'returns expected value' ) ;
191+ t . equal ( atan2d ( - 0.5 , - 0.0 ) , - 90.0 , 'returns expected value' ) ;
192+ t . end ( ) ;
193+ } ) ;
194+
174195tape ( 'the function evaluates the `atan2d` function (when x and y are positive)' , opts , function test ( t ) {
175196 var expected ;
176197 var actual ;
0 commit comments