]> granicus.if.org Git - postgresql/commitdiff
Made ecpglib write double with a precision of 15 digits.
authorMichael Meskes <meskes@postgresql.org>
Mon, 18 Jul 2011 14:30:51 +0000 (16:30 +0200)
committerMichael Meskes <meskes@postgresql.org>
Mon, 18 Jul 2011 14:32:42 +0000 (16:32 +0200)
Patch by Akira Kurosawa <kurosawa-akira@mxc.nes.nec.co.jp>.

src/interfaces/ecpg/ecpglib/execute.c

index d4e53b290e1a6b0339131efa0a99a371c2092ff8..51c5cdf8d801db9cc10fe100051127056e718cb5 100644 (file)
@@ -681,12 +681,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;
@@ -700,12 +700,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;