[Numpy-svn] r6208 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Sat Dec 27 08:44:21 CST 2008


Author: cdavid
Date: 2008-12-27 08:44:11 -0600 (Sat, 27 Dec 2008)
New Revision: 6208

Modified:
   trunk/numpy/core/src/scalartypes.inc.src
Log:
Fix formatting for purely imaginary complex numbers.

Modified: trunk/numpy/core/src/scalartypes.inc.src
===================================================================
--- trunk/numpy/core/src/scalartypes.inc.src	2008-12-27 13:48:52 UTC (rev 6207)
+++ trunk/numpy/core/src/scalartypes.inc.src	2008-12-27 14:44:11 UTC (rev 6208)
@@ -638,7 +638,9 @@
 {
     char format[32];
     if (val.real == 0.0) {
-        PyOS_snprintf(buf, buflen, CFMT1, prec, val.imag);
+        PyOS_snprintf(format, sizeof(format), "%%.%i" NPY_@NAME@_FMT, prec);
+        PyOS_ascii_formatd(buf, buflen - 1, format, val.imag);
+	strncat(buf, "j", 1);
     }
     else {
 	char re[64], im[64];



More information about the Numpy-svn mailing list