[gs-cvs] rev 6957 - trunk/gs/src

alexcher at ghostscript.com alexcher at ghostscript.com
Thu Aug 3 21:08:46 PDT 2006


Author: alexcher
Date: 2006-08-03 21:08:45 -0700 (Thu, 03 Aug 2006)
New Revision: 6957

Modified:
   trunk/gs/src/iutil.c
Log:
Re-format the exponent in floating point numbers to satisfy Genoa CET test.


Modified: trunk/gs/src/iutil.c
===================================================================
--- trunk/gs/src/iutil.c	2006-08-03 05:43:28 UTC (rev 6956)
+++ trunk/gs/src/iutil.c	2006-08-04 04:08:45 UTC (rev 6957)
@@ -505,11 +505,17 @@
 /*
  * Make sure the converted form of a real number has at least one of an 'e'
  * or a decimal point, so it won't be mistaken for an integer.
+ * Re-format the exponent to satisfy Genoa CET test.
  */
 private void
 ensure_dot(char *buf)
 {
-    if (strchr(buf, '.') == NULL && strchr(buf, 'e') == NULL) {
+    char *pe = strchr(buf, 'e');
+    if (pe) {
+        int i;
+        sscanf(pe + 1, "%d", &i);
+        sprintf(pe + 1, "%+02d", i);
+    } else if (strchr(buf, '.') == NULL) {
 	strcat(buf, ".0");
     }
 }



More information about the gs-cvs mailing list