uC-libc : round-off error in gcvt

From: checko (checko_at_gmail.com)
Date: 11/24/04


Date: 23 Nov 2004 23:06:36 -0800

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



Relevant Pages

  • Re: 1967 the greatest year for rock music
    ... youth" bug, I would be fond of a different set of music. ... the day which forever make me picture those times -- and I recognize the potential for having some wistful soft spot for such material. ...
    (rec.music.beatles)
  • =??Q?Re:_inconsistence_finding_dates_in_FM_pro_7_=3F?=
    ... As a former employer was fond of saying, "No tellin', not knowin'." ... There is any bug in this version regarding dates? ...
    (comp.databases.filemaker)