From 2023b3d128647d98eb7f92e0c5369a45c89fb3d4 Mon Sep 17 00:00:00 2001 From: David Johnson-Davies Date: Sun, 3 Feb 2019 10:15:08 +0000 Subject: [PATCH] Version 2.5b - 2nd February 2019 Fixes bug in printing floating-point numbers. --- ulisp-arm.ino | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ulisp-arm.ino b/ulisp-arm.ino index 932c40e..fed11aa 100644 --- a/ulisp-arm.ino +++ b/ulisp-arm.ino @@ -1,5 +1,5 @@ -/* uLisp ARM Version 2.5a - www.ulisp.com - David Johnson-Davies - www.technoblogy.com - 1st December 2018 +/* uLisp ARM Version 2.5b - www.ulisp.com + David Johnson-Davies - www.technoblogy.com - 2rd February 2019 Licensed under the MIT license: https://opensource.org/licenses/MIT */ @@ -3815,7 +3815,13 @@ void pmantissa (float f, pfun_t pfun) { int d = (int)(i / mul); pfun(d + '0'); i = i - d * mul; - if (i == 0) { if (!point) { pfun('.'); pfun('0'); } return; } + if (i == 0) { + if (!point) { + for (int k=0; k= 0) { pfun('.'); point = true; } mul = mul / 10; }