uC-libc : round-off error in gcvt

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

I fond a bug in gcvt.c, becase the round-off didn't add into the
integer part, when the number is 29.997 with digit 2 will be 29.00 .

and I found that just change one number:

k = f + 0.1/scale;
f2= f - k;


k = f + 0.5/scale;
f2= f - k;

this bug is corrected.

* there are 2 gcvt.c files, one is in libc/math, the other is in libm

Site Timeline