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 9 December 2014 at 12:38, Wang Weidong <wangweidong1@huawei.com> 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.

Siddhesh
-- 
http://siddhesh.in


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