Skip to content

Commit 1a02ef3

Browse files
author
Michael Meskes
committed
Made ecpglib write double with a precision of 15 digits.
Patch by Akira Kurosawa <kurosawa-akira@mxc.nes.nec.co.jp>.
1 parent 821c072 commit 1a02ef3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,12 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari
681681
strcpy(mallocedval, "array [");
682682

683683
for (element = 0; element < asize; element++)
684-
sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((float *) var->value)[element]);
684+
sprintf(mallocedval + strlen(mallocedval), "%.15g,", ((float *) var->value)[element]);
685685

686686
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
687687
}
688688
else
689-
sprintf(mallocedval, "%.14g", *((float *) var->value));
689+
sprintf(mallocedval, "%.15g", *((float *) var->value));
690690

691691
*tobeinserted_p = mallocedval;
692692
break;
@@ -700,12 +700,12 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari
700700
strcpy(mallocedval, "array [");
701701

702702
for (element = 0; element < asize; element++)
703-
sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((double *) var->value)[element]);
703+
sprintf(mallocedval + strlen(mallocedval), "%.15g,", ((double *) var->value)[element]);
704704

705705
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
706706
}
707707
else
708-
sprintf(mallocedval, "%.14g", *((double *) var->value));
708+
sprintf(mallocedval, "%.15g", *((double *) var->value));
709709

710710
*tobeinserted_p = mallocedval;
711711
break;

0 commit comments

Comments
 (0)