Made ecpglib write double with a precision of 15 digits.
authorMichael Meskes <[email protected]>
Mon, 18 Jul 2011 14:30:51 +0000 (16:30 +0200)
committerMichael Meskes <[email protected]>
Mon, 18 Jul 2011 14:31:57 +0000 (16:31 +0200)
Patch by Akira Kurosawa <[email protected]>.

src/interfaces/ecpg/ecpglib/execute.c

index 96aa96c464518d5f35e6c08b50ee2f2cc461201a..6836df65f6cdb24ebc68679c31dd4df5aaee10b0 100644 (file)
@@ -690,12 +690,12 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari
                    strcpy(mallocedval, "array [");
 
                    for (element = 0; element < asize; element++)
-                       sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((float *) var->value)[element]);
+                       sprintf(mallocedval + strlen(mallocedval), "%.15g,", ((float *) var->value)[element]);
 
                    strcpy(mallocedval + strlen(mallocedval) - 1, "]");
                }
                else
-                   sprintf(mallocedval, "%.14g", *((float *) var->value));
+                   sprintf(mallocedval, "%.15g", *((float *) var->value));
 
                *tobeinserted_p = mallocedval;
                break;
@@ -709,12 +709,12 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari
                    strcpy(mallocedval, "array [");
 
                    for (element = 0; element < asize; element++)
-                       sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((double *) var->value)[element]);
+                       sprintf(mallocedval + strlen(mallocedval), "%.15g,", ((double *) var->value)[element]);
 
                    strcpy(mallocedval + strlen(mallocedval) - 1, "]");
                }
                else
-                   sprintf(mallocedval, "%.14g", *((double *) var->value));
+                   sprintf(mallocedval, "%.15g", *((double *) var->value));
 
                *tobeinserted_p = mallocedval;
                break;