diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2013-07-20 17:00:06 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2013-07-20 17:00:06 (GMT) |
commit | 60d634ae4a89854b4e7468445eeafa556a7979c9 (patch) | |
tree | 5b8f3c0ac5b78fe31fd3fb475f8f6d4b82bc072d /Modules | |
parent | 2ef710e40f116a8d15c074f0682bfdf2521bbe23 (diff) | |
parent | 58ceecfe5ac0ad436d556b589870dd2df62731c0 (diff) | |
download | cpython-60d634ae4a89854b4e7468445eeafa556a7979c9.zip cpython-60d634ae4a89854b4e7468445eeafa556a7979c9.tar.gz cpython-60d634ae4a89854b4e7468445eeafa556a7979c9.tar.bz2 |
Issue #18513: Add workaround for OS X 10.8 cexp bug that leads to wrong cmath.rect(0.0,-0.0) results.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/cmathmodule.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c index 3021cf0..36bf4a1 100644 --- a/Modules/cmathmodule.c +++ b/Modules/cmathmodule.c @@ -1006,6 +1006,13 @@ cmath_rect(PyObject *self, PyObject *args) else errno = 0; } + else if (phi == 0.0) { + /* Workaround for buggy results with phi=-0.0 on OS X 10.8. See + bugs.python.org/issue18513. */ + z.real = r; + z.imag = r * phi; + errno = 0; + } else { z.real = r * cos(phi); z.imag = r * sin(phi); |