uC-libc : round-off error in gcvt

Nov 24, 2004 0 Replies

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;



to



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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required