Skip to content

Commit ef2c8b9

Browse files
fix: example error
1 parent c5689f5 commit ef2c8b9

File tree

5 files changed

+30
-41
lines changed

5 files changed

+30
-41
lines changed

lib/node_modules/@stdlib/math/base/special/atan2f/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ int main( void ) {
188188
- <span class="package-name">[`@stdlib/math/base/special/atanf`][@stdlib/math/base/special/atanf]</span><span class="delimiter">: </span><span class="description">compute the arctangent of a single-precision floating-point number.</span>
189189

190190
- <span class="package-name">[`@stdlib/math/base/special/atan2`][@stdlib/math/base/special/atan2]</span><span class="delimiter">: </span><span class="description">compute the angle in the plane (in radians) between the positive x-axis and the ray from (0,0) to the point (x,y).</span>
191+
191192
</section>
192193

193194
<!-- /.related -->

lib/node_modules/@stdlib/math/base/special/atan2f/lib/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ function atan2f( y, x ) {
120120
}
121121
return copysignf( 0.0, y );
122122
}
123-
124123
// Case: -x = y = +infinity
125124
if ( x === NINF && y === PINF ) {
126125
return 3.0 * PI04F; // 3π/4

lib/node_modules/@stdlib/math/base/special/atan2f/src/main.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "stdlib/constants/float32/half_pi.h"
3939
#include "stdlib/constants/float32/fourth_pi.h"
4040
#include "stdlib/constants/float32/pinf.h"
41-
#include "stdlib/constants/float32/ninf.h"
4241
#include "stdlib/constants/float32/pi.h"
4342
#include <stdint.h>
4443

@@ -95,15 +94,6 @@ float stdlib_base_atan2f( const float y, const float x ) {
9594
}
9695
return stdlib_base_copysignf( 0.0f, y );
9796
}
98-
99-
// Case: -x = y = +infinity
100-
if ( x == STDLIB_CONSTANT_FLOAT32_NINF && y == STDLIB_CONSTANT_FLOAT32_PINF ) {
101-
return 3.0f * STDLIB_CONSTANT_FLOAT32_FOURTH_PI; // 3π/4
102-
}
103-
// Case: x = y = -infinity
104-
if ( x == STDLIB_CONSTANT_FLOAT32_NINF && y == STDLIB_CONSTANT_FLOAT32_PINF ) {
105-
return -3.0f * STDLIB_CONSTANT_FLOAT32_FOURTH_PI; // -3π/4
106-
}
10797
// Case: x is -Infinity
10898
if ( stdlib_base_is_infinitef( y ) ) {
10999
return stdlib_base_copysignf( 3.0f * STDLIB_CONSTANT_FLOAT32_FOURTH_PI, y );

lib/node_modules/@stdlib/math/base/special/atan2f/test/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ tape( 'the function returns `-0` if provided `y = -0.0` and `x >= 0`', function
7979
});
8080

8181
tape( 'the function returns `PI` if provided `y = +0.0` and `x <= -0.0`', function test( t ) {
82-
t.equal( ( atan2f( +0.0, -0.0 ) ) , +PI, 'returns +PI' );
83-
t.equal( ( atan2f( +0.0, -2.0 ) ) , +PI, 'returns +PI' );
84-
t.equal( ( atan2f( +0.0, -4.0 ) ) , +PI, 'returns +PI' );
85-
t.equal( ( atan2f( +0.0, -5.0 ) ) , +PI, 'returns +PI' );
86-
t.equal( ( atan2f( +0.0, -10.0 ) ) , +PI, 'returns +PI' );
82+
t.equal( ( atan2f( +0.0, -0.0 ) ), +PI, 'returns +PI' );
83+
t.equal( ( atan2f( +0.0, -2.0 ) ), +PI, 'returns +PI' );
84+
t.equal( ( atan2f( +0.0, -4.0 ) ), +PI, 'returns +PI' );
85+
t.equal( ( atan2f( +0.0, -5.0 ) ), +PI, 'returns +PI' );
86+
t.equal( ( atan2f( +0.0, -10.0 ) ), +PI, 'returns +PI' );
8787
t.end();
8888
});
8989

@@ -219,7 +219,7 @@ tape( 'the function evaluates the `atan2f` function (when x and y are negative)'
219219
for ( i = 0; i < x.length; i++ ) {
220220
actual = atan2f( y[i], x[i] );
221221
delta = absf( actual - expected[i] );
222-
tol = 2.0* EPS * absf( expected[i] );
222+
tol = 2.0 * EPS * absf( expected[i] );
223223
t.equal( delta <= tol, true, 'within tolerance. y: '+y[i]+'. x: '+x[i]+'. Actual: '+actual+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
224224
}
225225
t.end();

lib/node_modules/@stdlib/math/base/special/atan2f/test/test.native.js

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020

2121
// MODULES //
2222

23-
var resolve = require( 'path' ).resolve;
2423
var tape = require( 'tape' );
2524
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2625
var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );
2726
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
2827
var absf = require( '@stdlib/math/base/special/absf' );
29-
var tryRequire = require( '@stdlib/utils/try-require' );
3028
var EPS = require( '@stdlib/constants/float32/eps' );
3129
var PINF = require( '@stdlib/constants/float32/pinf' );
3230
var NINF = require( '@stdlib/constants/float32/ninf' );
31+
var PI02F = require( '@stdlib/constants/float32/half-pi' );
32+
var PI04F = require( '@stdlib/constants/float32/fourth-pi' );
3333
var PI = require( '@stdlib/constants/float32/pi' );
3434

3535

@@ -50,7 +50,6 @@ var opts = {
5050

5151
// TESTS //
5252

53-
5453
tape( '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

8988
tape( '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

107106
tape( '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

112111
tape( '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

117116
tape( '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

122121
tape( '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

155154
tape( '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

162161
tape( '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

169168
tape( '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

Comments
 (0)