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

Mike Frysinger vapier@gentoo.org
Mon Mar 2 03:43:00 GMT 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-help/attachments/20150302/1d011051/attachment.sig>


More information about the Libc-help mailing list