This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: read float into integer


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]