summaryrefslogtreecommitdiffstats
path: root/Modules/cmathmodule.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-12-21 15:22:00 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-12-21 15:22:00 (GMT)
commit12748b003c69765e611a7c1782310f33f806607d (patch)
tree927cdb616ba9ceccecebd32e22585864af10a76a /Modules/cmathmodule.c
parent08dca0d6daf46eecb758c8765fdb592211122d47 (diff)
downloadcpython-12748b003c69765e611a7c1782310f33f806607d.zip
cpython-12748b003c69765e611a7c1782310f33f806607d.tar.gz
cpython-12748b003c69765e611a7c1782310f33f806607d.tar.bz2
Issue #7518: Move substitute definitions of C99 math functions from
pymath.c to Modules/_math.c.
Diffstat (limited to 'Modules/cmathmodule.c')
-rw-r--r--Modules/cmathmodule.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index 7b2e316..788a19d 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>
@@ -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);
}