PR libgfortran/28354
* io/write.c: Check for special case of zero precision in format
and pre-round the real value.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116502
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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;