This is the mail archive of the newlib@sourceware.org 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]
Other format: [Raw text]

printf("%.0f", 0.5) and round-to-even


Based on a report on bug-gnu-utils:
 http://lists.gnu.org/archive/html/bug-gnu-utils/2008-09/msg00055.html
It looks like the printf family could use a QoI improvement when dealing with 
IEEE round-to-even rules.  I'll try and look at making this improvement in the 
next few days.

                    glibc  newlib
printf("%.0f",0.5)      0       1
printf("%.0f",1.5)      2       1
printf("%.0f",2.5)      2       2
printf("%.0f",3.5)      4       3

-- 
Eric Blake



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