Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Error 64: result not 0?

Intel_C_Intel
Employee
435 Views
Given the program (tinpconerr.for):

CHARACTER S*13
REAL RVALUE
S = '1.7014119D+38'
READ(S(1:13),'(G15.0)',IOSTAT=IOS) RVALUE
WRITE(*,'(I5,5X,G25.16)') IOS,RVALUE
END

Compiled, linked and run:

$ for tinpconerr
$ link tinpconerr
$ run tinpconerr
64 0.1701411733192644E+39

Result is close to greatest real but manual says it should be 0. According to the documentation:

Run_Time_Messages
INPCONERR
NUMBER: 64
ERROR CODE: F
MESSAGE TEXT: input conversion error
EXPLANATION: During a formatted input operation, an invalid
character was detected in an input field, or the input value
overflowed the range representable in the input variable.
The value of the variable was set to zero.


is the manual in error? or is something wrong with this program?

Willem Grooters
0 Kudos
2 Replies
sabalan
New Contributor I
435 Views
I get, with your code, 0 and 0.1701411834604692E+39 (CVF 6.1a, W2K, Pentium II) AND you should declare RVALUE as REAL(8), not REAL. Then I get 0 and 0.1701411000000000E+39.

Any 64!

Regards,
Sabalan.
0 Kudos
Steven_L_Intel1
Employee
435 Views
I can reproduce the behavior on VMS.

The Fortran standard says that the values of all variables in the I/O list of a READ become undefined if an error condition occurs. I'm not sure why the manual says the value is set to zero - we'll look at that. My view, offhand, is that the documentation is wrong.

Steve
0 Kudos
Reply