summaryrefslogtreecommitdiff
path: root/Modules/cmathmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/cmathmodule.c')
-rw-r--r--Modules/cmathmodule.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index eec61c09bb..0dc6bdb396 100644
--- a/Modules/cmathmodule.c
+++ b/Modules/cmathmodule.c
@@ -3,6 +3,7 @@
/* much code borrowed from mathmodule.c */
#include "Python.h"
+#include "_math.h"
/* we need DBL_MAX, DBL_MIN, DBL_EPSILON, DBL_MANT_DIG and FLT_RADIX from
float.h. We assume that FLT_RADIX is either 2 or 16. */
#include <float.h>
@@ -22,7 +23,7 @@
/*
CM_LARGE_DOUBLE is used to avoid spurious overflow in the sqrt, log,
inverse trig and inverse hyperbolic trig functions. Its log is used in the
- evaluation of exp, cos, cosh, sin, sinh, tan, and tanh to avoid unecessary
+ evaluation of exp, cos, cosh, sin, sinh, tan, and tanh to avoid unnecessary
overflow.
*/
@@ -149,7 +150,7 @@ c_acos(Py_complex z)
s2.imag = z.imag;
s2 = c_sqrt(s2);
r.real = 2.*atan2(s1.real, s2.real);
- r.imag = asinh(s2.real*s1.imag - s2.imag*s1.real);
+ r.imag = m_asinh(s2.real*s1.imag - s2.imag*s1.real);
}
errno = 0;
return r;
@@ -181,7 +182,7 @@ c_acosh(Py_complex z)
s2.real = z.real + 1.;
s2.imag = z.imag;
s2 = c_sqrt(s2);
- r.real = asinh(s1.real*s2.real + s1.imag*s2.imag);
+ r.real = m_asinh(s1.real*s2.real + s1.imag*s2.imag);
r.imag = 2.*atan2(s1.imag, s2.real);
}
errno = 0;
@@ -238,7 +239,7 @@ c_asinh(Py_complex z)
s2.real = 1.-z.imag;
s2.imag = z.real;
s2 = c_sqrt(s2);
- r.real = asinh(s1.real*s2.imag-s2.real*s1.imag);
+ r.real = m_asinh(s1.real*s2.imag-s2.real*s1.imag);
r.imag = atan2(z.imag, s1.real*s2.real-s1.imag*s2.imag);
}
errno = 0;
@@ -342,7 +343,7 @@ c_atanh(Py_complex z)
errno = 0;
}
} else {
- r.real = log1p(4.*z.real/((1-z.real)*(1-z.real) + ay*ay))/4.;
+ r.real = m_log1p(4.*z.real/((1-z.real)*(1-z.real) + ay*ay))/4.;
r.imag = -atan2(-2.*z.imag, (1-z.real)*(1+z.real) - ay*ay)/2.;
errno = 0;
}
@@ -552,7 +553,7 @@ c_log(Py_complex z)
if (0.71 <= h && h <= 1.73) {
am = ax > ay ? ax : ay; /* max(ax, ay) */
an = ax > ay ? ay : ax; /* min(ax, ay) */
- r.real = log1p((am-1)*(am+1)+an*an)/2.;
+ r.real = m_log1p((am-1)*(am+1)+an*an)/2.;
} else {
r.real = log(h);
}