This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/4858] printf alternate %#g format prints wrong number of digits
- From: "jakub at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 27 Jul 2007 20:10:08 -0000
- Subject: [Bug libc/4858] printf alternate %#g format prints wrong number of digits
- References: <20070727184733.4858.wirawan0@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.