printf("%.0f", 0.1) => 0.

J. Johnston jjohnstn@cygnus.com
Wed Aug 16 11:20:00 GMT 2000


"Fifer, Eric" wrote:
> 
> I discovered this when testing the latest Perl:
> 
>         main()
>         {
>                 printf("%.0f\n", 0.1);
>                 printf("%.0f\n", -0.1);
>         }
> 
> Produces:
> 
>         0.
>         -0.
> 
> The trailing dot is the problem.  Attached is a suggested
> change that seems to fix the problem and not introduce any
> others.
> 
> Regards,
> 
> Eric Fifer
>

Patch has been applied to sourceware.

Thanks,

-- Jeff Johnston (Red Hat Inc.)


More information about the Newlib mailing list