1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

[BZ 4858]

* stdio-common/printf_fp.c (___printf_fp): Fix special case of
	#.0g and value rounded to 1.0.
	* stdio-common/tfformat.c (sprint_doubles): Add two new tests.
This commit is contained in:
Ulrich Drepper
2007-07-29 00:26:28 +00:00
parent cedb410957
commit 8f5e140031
3 changed files with 13 additions and 1 deletions

View File

@@ -986,7 +986,9 @@ ___printf_fp (FILE *fp,
if (*wtp != decimalwc)
/* Round up. */
(*wtp)++;
else if (__builtin_expect (spec == 'g' && type == 'f' && info->alt,
else if (__builtin_expect (spec == 'g' && type == 'f' && info->alt
&& wtp == wstartp + 1
&& wstartp[0] == L'0',
0))
/* This is a special case: the rounded number is 1.0,
the format is 'g' or 'G', and the alternative format