mirror of https://github.com/python/cpython
Minor rewrite of cmath_log to work around a Sun compiler bug. See issue
#3168.
This commit is contained in:
parent
bf9f4d8015
commit
ecf8d8cc4b
|
@ -839,8 +839,10 @@ cmath_log(PyObject *self, PyObject *args)
|
||||||
errno = 0;
|
errno = 0;
|
||||||
PyFPE_START_PROTECT("complex function", return 0)
|
PyFPE_START_PROTECT("complex function", return 0)
|
||||||
x = c_log(x);
|
x = c_log(x);
|
||||||
if (PyTuple_GET_SIZE(args) == 2)
|
if (PyTuple_GET_SIZE(args) == 2) {
|
||||||
x = c_quot(x, c_log(y));
|
y = c_log(y);
|
||||||
|
x = c_quot(x, y);
|
||||||
|
}
|
||||||
PyFPE_END_PROTECT(x)
|
PyFPE_END_PROTECT(x)
|
||||||
if (errno != 0)
|
if (errno != 0)
|
||||||
return math_error();
|
return math_error();
|
||||||
|
|
Loading…
Reference in New Issue