diff Modules/cmathmodule.c @ 47890:f772476ad90d legacy-trunk

Minor rewrite of cmath_log to work around a Sun compiler bug. See issue #3168.
author Mark Dickinson <dickinsm@gmail.com>
date Sat, 05 Jul 2008 15:25:48 +0000
parents 54fd0458550c
children 676567e2a711
line wrap: on
line diff
--- a/Modules/cmathmodule.c	Sat Jul 05 11:33:52 2008 +0000
+++ b/Modules/cmathmodule.c	Sat Jul 05 15:25:48 2008 +0000
@@ -839,8 +839,10 @@
 	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();