This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: read float into integer
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: pkienzle <pkienzle at gmail dot com>, fortran at gcc dot gnu dot org
- Date: Thu, 30 Aug 2007 07:05:03 +0200
- Subject: Re: read float into integer
- References: <12394785.post@talk.nabble.com> <46D5D3B9.5070402@net-b.de>
Hello Paul,
Long time, no hear!
pkienzle wrote:
I don't know if it is a bug, but gfortran does not truncate floating point
values toward 0 on input. The f90 code I'm trying to compile assumes that
it does.
This seems to be a very special Intel Fortran Compiler feature as I get:
10.8.1 List-directed input
Input forms acceptable to edit descriptors for a given type are
acceptable for list-directed
formatting, except as noted below. The form of the input value shall be
acceptable for the type of
the next effective item in the list. Blanks are never used as zeros, and
embedded blanks are not
permitted in constants, except within character constants and complex
constants as specified
below.
When the next effective item is of type integer, the value in the input
record is interpreted as if an
Iw edit descriptor with a suitable value of w were used.
.....snip.....
When the next effective item is of type logical, the input form shall
not include slashes, blanks, or
commas among the optional characters permitted for L editing.
So I would say that the ifort behaviour is unexpected, if not a bug.
Cheers
Paul