[PATCH] libgfortran/28354 - 0.99999 printed as 0. instead of 1. by format(f3.0)
Jerry DeLisle
jvdelisle@verizon.net
Mon Aug 28 03:46:00 GMT 2006
:ADDPATCH fortran:
The attached patch fixes this PR by adjusting the real value prior to processing
to get the correct output when processed through the formatting. I was
pursuing catching this special case further down in the code and modifying the
handling of the nbefore, nafter, nzero, etc variables that define the output.
This was working mostly when I discovered I would have to special case the
rounding as well. Then it occurred to me to handle that before all the
processing and this gave a much cleaner fix.
Regression tested and NIST tested. New test case included.
OK for trunk 4.2? and 4.1 later?
Regards,
Jerry
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr28354.diff
Type: text/x-patch
Size: 596 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060828/5c31cf9e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fmt_zero_precision.f90
Type: text/x-fortran
Size: 735 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060828/5c31cf9e/attachment-0001.bin>
More information about the Fortran
mailing list