From 22deffb46e3528e10a64f2038d8820b931e38877 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sat, 12 Feb 2011 15:57:52 +0900 Subject: [PATCH] read will truncate floating point numbers if SEXP_USE_FLONUMS is false --- sexp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sexp.c b/sexp.c index be2caed1..9d643677 100644 --- a/sexp.c +++ b/sexp.c @@ -1570,9 +1570,13 @@ sexp sexp_read_float_tail (sexp ctx, sexp in, double whole, int negp) { } else { sexp_push_char(ctx, c, in); } +#if SEXP_USE_FLONUMS res = (whole + res) * pow(10, e); if (negp) res *= -1; return sexp_make_flonum(ctx, res); +#else + return sexp_make_fixnum((sexp_uint_t)whole); +#endif } sexp sexp_read_number (sexp ctx, sexp in, int base) {