From 36c124fa80b760d8455f807d605ee14b15c18572 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 5 Jul 2016 23:34:38 -0400 Subject: [PATCH] Added TODO --- runtime.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime.c b/runtime.c index 327bd60d..5c49371a 100644 --- a/runtime.c +++ b/runtime.c @@ -650,6 +650,15 @@ object Cyc_display(object x, FILE * port) break; case double_tag: fprintf(port, "%.16g", ((double_type *) x)->value); + +// TODO: extract this out into a common function, and call it here and in number->string. + // From chibi-scheme. g minimizes the amount of displayed information, and no decimal point is + // printed for whole-number doubles (EG: 3.0 is printed as 3). so detect those cases and add ".0" +// i = snprintf(numbuf, NUMBUF_LEN, "%.15g", f); // buflen is 32 +// if (!strchr(numbuf, '.') && !strchr(numbuf, 'e')) { +// numbuf[i++] = '.'; numbuf[i++] = '0'; numbuf[i++] = '\0'; +// } + break; case string_tag: fprintf(port, "%s", ((string_type *) x)->str);