This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Ask for help]: Met a problem with printf and gcvt


On 09 Dec 2014 15:28, Wang Weidong wrote:
> On 2014/12/9 15:11, Siddhesh Poyarekar wrote:
> > On 9 December 2014 at 12:38, Wang Weidong wrote:
> >> When I was using the printf() and gcvt(), I got a difference below:
> >>
> >> ------------------------------------------------------------
> >>
> >> On Uclibc(0.9.31):
> >>
> >> printf("%.1f\n",3.25);   ------>3.3
> >>
> >> gcvt(1e-100, 20, buf);
> >> printf("%s\n", buf);     ------>1.0000000000000001e-100
> >>
> >> -----------------------------
> >>
> >> On Glibc(2.18/2.19/2.11):
> >>
> >> printf("%.1f\n",3.25);   ------>3.2
> >>
> >> gcvt(1e-100, 20, buf);
> >> printf("%s\n", buf);     ------>1e-100
> >>
> >> ------------------------------------------------------------
> >>
> >> Is it a problem on the uclibc or on glibc?
> > 
> > Obviously a problem with uclibc since it is losing precision.
> 
> If so, Is there a patch to fix this problem?

this is the glibc list.  you'd have to ask on the uclibc lists about uclibc.
-mike

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]