mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-09 14:07:34 +02:00
Always ensure a trailing .0 when a printed flonum has neither a decimal nor e.
This commit is contained in:
parent
ce7d8505f8
commit
4ade4f7d2a
1 changed files with 1 additions and 1 deletions
2
sexp.c
2
sexp.c
|
@ -1864,7 +1864,7 @@ sexp sexp_write_one (sexp ctx, sexp obj, sexp out) {
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
i = snprintf(numbuf, NUMBUF_LEN, "%.15g", f);
|
i = snprintf(numbuf, NUMBUF_LEN, "%.15g", f);
|
||||||
if (f == trunc(f) && ! strchr(numbuf, '.')) {
|
if (!strchr(numbuf, '.') && !strchr(numbuf, 'e')) {
|
||||||
numbuf[i++] = '.'; numbuf[i++] = '0'; numbuf[i++] = '\0';
|
numbuf[i++] = '.'; numbuf[i++] = '0'; numbuf[i++] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue