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
1 changed files with 4 additions and 4 deletions

View File

@ -672,12 +672,12 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
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;
*malloced_p = true;
@ -692,12 +692,12 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
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;
*malloced_p = true;