summaryrefslogtreecommitdiff
path: root/Modules/cmathmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/cmathmodule.c')
-rw-r--r--Modules/cmathmodule.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index 3021cf0466..36bf4a1e3d 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);