1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Made ecpglib write double with a precision of 15 digits.

Patch by Akira Kurosawa <kurosawa-akira@mxc.nes.nec.co.jp>.
This commit is contained in:
Michael Meskes
2011-07-18 16:30:51 +02:00
parent e2bf629599
commit e9a1a0d00b

View File

@ -672,12 +672,12 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strcpy(mallocedval, "array ["); strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++) 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, "]"); strcpy(mallocedval + strlen(mallocedval) - 1, "]");
} }
else else
sprintf(mallocedval, "%.14g", *((float *) var->value)); sprintf(mallocedval, "%.15g", *((float *) var->value));
*tobeinserted_p = mallocedval; *tobeinserted_p = mallocedval;
*malloced_p = true; *malloced_p = true;
@ -692,12 +692,12 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strcpy(mallocedval, "array ["); strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++) 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, "]"); strcpy(mallocedval + strlen(mallocedval) - 1, "]");
} }
else else
sprintf(mallocedval, "%.14g", *((double *) var->value)); sprintf(mallocedval, "%.15g", *((double *) var->value));
*tobeinserted_p = mallocedval; *tobeinserted_p = mallocedval;
*malloced_p = true; *malloced_p = true;