@@ -535,43 +535,6 @@ m_lgamma(double x)
535535 return r ;
536536}
537537
538- /*
539- wrapper for atan2 that deals directly with special cases before
540- delegating to the platform libm for the remaining cases. This
541- is necessary to get consistent behaviour across platforms.
542- Windows, FreeBSD and alpha Tru64 are amongst platforms that don't
543- always follow C99.
544- */
545-
546- static double
547- m_atan2 (double y , double x )
548- {
549- if (isnan (x ) || isnan (y ))
550- return Py_NAN ;
551- if (isinf (y )) {
552- if (isinf (x )) {
553- if (copysign (1. , x ) == 1. )
554- /* atan2(+-inf, +inf) == +-pi/4 */
555- return copysign (0.25 * Py_MATH_PI , y );
556- else
557- /* atan2(+-inf, -inf) == +-pi*3/4 */
558- return copysign (0.75 * Py_MATH_PI , y );
559- }
560- /* atan2(+-inf, x) == +-pi/2 for finite x */
561- return copysign (0.5 * Py_MATH_PI , y );
562- }
563- if (isinf (x ) || y == 0. ) {
564- if (copysign (1. , x ) == 1. )
565- /* atan2(+-y, +inf) = atan2(+-0, +x) = +-0. */
566- return copysign (0. , y );
567- else
568- /* atan2(+-y, -inf) = atan2(+-0., -x) = +-pi. */
569- return copysign (Py_MATH_PI , y );
570- }
571- return atan2 (y , x );
572- }
573-
574-
575538/* IEEE 754-style remainder operation: x - n*y where n*y is the nearest
576539 multiple of y to x, taking n even in the case of a tie. Assuming an IEEE 754
577540 binary floating-point format, the result is always exact. */
@@ -1103,7 +1066,7 @@ FUNC1(atan, atan, 0,
11031066 "atan($module, x, /)\n--\n\n"
11041067 "Return the arc tangent (measured in radians) of x.\n\n"
11051068 "The result is between -pi/2 and pi/2." )
1106- FUNC2 (atan2 , m_atan2 ,
1069+ FUNC2 (atan2 , atan2 ,
11071070 "atan2($module, y, x, /)\n--\n\n"
11081071 "Return the arc tangent (measured in radians) of y/x.\n\n"
11091072 "Unlike atan(y/x), the signs of both x and y are considered." )
0 commit comments