mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 03:40:26 +08:00
re PR libfortran/28354 ([4.1 Only] 0.99999 printed as 0. instead of 1. by format(f3.0))
2006-08-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/28354 * io/write.c: Check for special case of zero precision in format and pre-round the real value. From-SVN: r116502
This commit is contained in:
parent
7f22b9fca4
commit
20e1580fad
@ -1,3 +1,9 @@
|
||||
2006-08-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/28354
|
||||
* io/write.c: Check for special case of zero precision in format
|
||||
and pre-round the real value.
|
||||
|
||||
2006-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/25828
|
||||
|
@ -426,6 +426,15 @@ output_float (st_parameter_dt *dtp, const fnode *f, GFC_REAL_LARGEST value)
|
||||
if (value < 0)
|
||||
value = -value;
|
||||
|
||||
/* Special case when format specifies no digits after the decimal point. */
|
||||
if (d == 0)
|
||||
{
|
||||
if (value < 0.5)
|
||||
value = 0.0;
|
||||
else if (value < 1.0)
|
||||
value = value + 0.5;
|
||||
}
|
||||
|
||||
/* Printf always prints at least two exponent digits. */
|
||||
if (value == 0)
|
||||
edigits = 2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user