Version 2.5b - 2nd February 2019

Fixes bug in printing floating-point numbers.
This commit is contained in:
David Johnson-Davies 2019-02-03 10:15:08 +00:00 committed by GitHub
parent 19b67ebe7e
commit 2023b3d128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -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<sig; k++) pfun('0');
pfun('.'); pfun('0');
}
return;
}
if (j == sig && sig >= 0) { pfun('.'); point = true; }
mul = mul / 10;
}