This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


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

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



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

printf.patch


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