diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2008-07-05 15:25:48 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2008-07-05 15:25:48 (GMT) |
commit | ecf8d8cc4bc62f7c93c3714b61ff354c37cd5504 (patch) | |
tree | 7fd7a675aaf140e8b8419bd89856365fb4b1a414 /Modules/cmathmodule.c | |
parent | bf9f4d801530f4b4f40fe7baf93b1b4d55873275 (diff) | |
download | cpython-ecf8d8cc4bc62f7c93c3714b61ff354c37cd5504.zip cpython-ecf8d8cc4bc62f7c93c3714b61ff354c37cd5504.tar.gz cpython-ecf8d8cc4bc62f7c93c3714b61ff354c37cd5504.tar.bz2 |
Minor rewrite of cmath_log to work around a Sun compiler bug. See issue
#3168.
Diffstat (limited to 'Modules/cmathmodule.c')
-rw-r--r-- | Modules/cmathmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c index 109f2cc..42af08c 100644 --- a/Modules/cmathmodule.c +++ b/Modules/cmathmodule.c @@ -839,8 +839,10 @@ cmath_log(PyObject *self, PyObject *args) errno = 0; PyFPE_START_PROTECT("complex function", return 0) x = c_log(x); - if (PyTuple_GET_SIZE(args) == 2) - x = c_quot(x, c_log(y)); + if (PyTuple_GET_SIZE(args) == 2) { + y = c_log(y); + x = c_quot(x, y); + } PyFPE_END_PROTECT(x) if (errno != 0) return math_error(); |