summaryrefslogtreecommitdiffstats
path: root/Modules/cmathmodule.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-12-21 15:27:41 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-12-21 15:27:41 (GMT)
commitf371859a4f0705062e94798e21ebe3705d891a37 (patch)
treec4b520a35156bd0d6729980b1253a4ce04bf39c3 /Modules/cmathmodule.c
parent0f72d6c25fb3ff16b4c459221d56f87f221c59d0 (diff)
downloadcpython-f371859a4f0705062e94798e21ebe3705d891a37.zip
cpython-f371859a4f0705062e94798e21ebe3705d891a37.tar.gz
cpython-f371859a4f0705062e94798e21ebe3705d891a37.tar.bz2
Merged revisions 76978 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76978 | mark.dickinson | 2009-12-21 15:22:00 +0000 (Mon, 21 Dec 2009) | 3 lines 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 fbf6ece..4d13e58 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);
}