This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/35862] [F2003] Implement new rounding modes for run time
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Oct 2009 01:37:40 -0000
- Subject: [Bug libfortran/35862] [F2003] Implement new rounding modes for run time
- References: <bug-35862-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from jvdelisle at gcc dot gnu dot org 2009-10-01 01:37 -------
Rounding modes are now implemented for formatted WRITE operations. I do not
have a clear enough idea of what the rounding modes really mean for READ
operations. For example:
>From Comment #4
"Rounding is done for all I/O, including input. For example, if you have:
read ("0.1", *, rounding="up") x
read ("0.1", *, rounding="down") y
then you will have x == nearest(y, -1.)"
Is this really what is meant by rounding up or down? The internal
representation of .1 may already be rounded up or down from a binary
representation that carried more bits in the conversion process. If we do not
have access to more bits, how are we to know whether it is not already "half
way in between"
Similarly with nearest. By definition the result of the intrinsic nearest is
already the next bit up or down from the internally stored value. So what does
"rounding" ,mean here? Does it mean if the LSB is a 1 turn it into a 0 and if
it is a 0, leave it a zero?
This all seems absurd to my practical side. The Fortran standard seems very
vague to me and yet it does imply rounding on input. Suggestions anyone?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35862