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

numpy-svn@scip... numpy-svn@scip...
Sat Dec 27 10:33:53 CST 2008


Author: cdavid
Date: 2008-12-27 10:33:40 -0600 (Sat, 27 Dec 2008)
New Revision: 6217

Modified:
   trunk/numpy/core/src/scalartypes.inc.src
Log:
Do not use PyOS_ascii_formatd, as it does not handle long double correctly.

Modified: trunk/numpy/core/src/scalartypes.inc.src
===================================================================
--- trunk/numpy/core/src/scalartypes.inc.src	2008-12-27 16:17:27 UTC (rev 6216)
+++ trunk/numpy/core/src/scalartypes.inc.src	2008-12-27 16:33:40 UTC (rev 6217)
@@ -619,7 +619,7 @@
     register char* cp;
 
     PyOS_snprintf(format, sizeof(format), "%%.%i" NPY_@NAME@_FMT, prec);
-    PyOS_ascii_formatd(buf, buflen, format, val);
+    PyOS_snprintf(buf, buflen, format, val);
     cp = buf;
     if (*cp == '-') {
         ++cp;
@@ -670,14 +670,14 @@
     char format[32];
     if (val.real == 0.0) {
         PyOS_snprintf(format, sizeof(format), "%%.%i" NPY_@NAME@_FMT, prec);
-        PyOS_ascii_formatd(buf, buflen - 1, format, val.imag);
+        PyOS_snprintf(buf, buflen - 1, format, val.imag);
         strncat(buf, "j", 1);
     } else {
         char re[64], im[64];
         PyOS_snprintf(format, sizeof(format), "%%.%i" NPY_@NAME@_FMT, prec);
-        PyOS_ascii_formatd(re, sizeof(re), format, val.real);
+        PyOS_snprintf(re, sizeof(re), format, val.real);
         PyOS_snprintf(format, sizeof(format), "%%+.%i" NPY_@NAME@_FMT, prec);
-        PyOS_ascii_formatd(im, sizeof(im), format, val.imag);
+        PyOS_snprintf(im, sizeof(im), format, val.imag);
         PyOS_snprintf(buf, buflen, "(%s%sj)", re, im);
     }
 }



More information about the Numpy-svn mailing list