Skip to content

Commit ebd654e

Browse files
fix: revert previous chnages
1 parent d26a02c commit ebd654e

File tree

2 files changed

+14
-17
lines changed
  • lib/node_modules/@stdlib/math/base/special/atan2f

2 files changed

+14
-17
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,17 @@ function atan2f( y, x ) {
122122
return copysignf( 0.0, y );
123123
}
124124
}
125+
// Case: -x = y = +infinity
126+
if ( x === NINF && y === PINF ) {
127+
return 3.0 * PI04F; // 3π/4
128+
}
129+
// Case: x = y = -infinity
130+
if ( x === NINF && y === NINF ) {
131+
return -3.0 * PI04F; // -3π/4
132+
}
125133
// Case: x is -Infinity
126-
if ( x === NINF ) {
127-
if ( y === PINF ) {
128-
return 3.0 * PI04F; // 3π/4
129-
}
130-
if ( y === NINF ) {
131-
return -3.0 * PI04F; // -3π/4
132-
}
133-
return copysignf( PI, y );
134+
if ( isinfinitef( y ) ) {
135+
return copysignf( 3.0*PI04F, y );
134136
}
135137
if ( isinfinitef( y ) ) {
136138
return copysignf( PI02F, y );

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,11 @@ float stdlib_base_atan2f( const float y, const float x ) {
9595
}
9696
return stdlib_base_copysignf( 0.0f, y );
9797
}
98-
// Case: x is -Infinity
99-
if ( x == STDLIB_CONSTANT_FLOAT32_NINF ) {
100-
if ( y == STDLIB_CONSTANT_FLOAT32_PINF ) {
101-
return 3.0f * STDLIB_CONSTANT_FLOAT32_FOURTH_PI; // 3π/4
102-
}
103-
if ( y == STDLIB_CONSTANT_FLOAT32_NINF ) {
104-
return -3.0f * STDLIB_CONSTANT_FLOAT32_FOURTH_PI; // -3π/4
105-
}
106-
return stdlib_base_copysignf( STDLIB_CONSTANT_FLOAT32_PI, y );
98+
// case x is -Infinity
99+
if ( stdlib_base_is_infinitef( y ) ) {
100+
return stdlib_base_copysignf( 3.0f * STDLIB_CONSTANT_FLOAT32_FOURTH_PI, y );
107101
}
102+
return stdlib_base_copysignf( STDLIB_CONSTANT_FLOAT32_PI, y );
108103
}
109104
if ( stdlib_base_is_infinitef( y ) ) {
110105
return stdlib_base_copysignf( STDLIB_CONSTANT_FLOAT32_HALF_PI, y );

0 commit comments

Comments
 (0)