This is the mail archive of the glibc-bugs@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]

[Bug libc/4858] printf alternate %#g format prints wrong number of digits


------- Additional Comments From jakub at redhat dot com  2007-07-27 20:10 -------
This is a regression caused by the BZ#4070 fix, particularly the
+           else if (__builtin_expect (spec == 'g' && type == 'f' && info->alt,
+                                      0))
+             /* This is a special case: the rounded number is 1.0,
+                the format is 'g' or 'G', and the alternative format
+                is selected.  This means the result must be "1.".  */
+             --added_zeros;
hunk.  It is IMHO only valid when the the integral part is all nines (or empty),
i.e. when we'll need more int digits, but we don't know this at this point.
For the "%#.0g", 0.956 case which got fixes that is true and similarly for
"%#.4g", 999.98, but not for this "%#.4g", 912.98.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=4858

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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