Minor rewrite of cmath_log to work around a Sun compiler bug. See issue

#3168.
This commit is contained in:
Mark Dickinson 2008-07-05 15:25:48 +00:00
parent bf9f4d8015
commit ecf8d8cc4b
1 changed files with 4 additions and 2 deletions

View File

@ -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();