[Python-checkins] r64735 - python/trunk/Modules/cmathmodule.c

mark.dickinson python-checkins at python.org
Sat Jul 5 17:25:49 CEST 2008


Author: mark.dickinson
Date: Sat Jul  5 17:25:48 2008
New Revision: 64735

Log:
Minor rewrite of cmath_log to work around a Sun compiler bug.  See issue 
#3168.


Modified:
   python/trunk/Modules/cmathmodule.c

Modified: python/trunk/Modules/cmathmodule.c
==============================================================================
--- python/trunk/Modules/cmathmodule.c	(original)
+++ python/trunk/Modules/cmathmodule.c	Sat Jul  5 17:25:48 2008
@@ -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();


More information about the Python-checkins mailing list