FIX: F6100 Reading Maximal Negative IntegersLast reviewed: September 16, 1997Article ID: Q104896 |
1.00 1.00a | 1.00
MS-DOS | WINDOWS NTkbprg kbfixlist kberrmsg The information in this article applies to:
SYMPTOMSFor any integer data type, reading the smallest negative integer of that range generates the run-time error F6100 indicating that there was an INTEGER overflow on input.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft FORTRAN PowerStation 32, version 4.0.
MORE INFORMATIONThe smallest negative integer for each integer data type is:
-128 Integer*1
-32768 Integer*2
-2147483648 Integer*4
The sample code below generates the 6100 error for all integer types
when compiled with PowerStation, but only generates the 6100 error for
integer*4 with FORTRAN 5.1 and earlier.
Sample CodeC No Compiler options needed integer*1 i
integer*2 j
integer*4 k
open(1,file='test.dat')
do 10 n=3,5
write(1,*) -2**((2**n-1))
10 continue
rewind(1)
read(1,*,iostat=ierr) i
if(ierr.eq.6100) then
print*, 'error reading integer*1 was: ',ierr
else
print*, 'integer*1 input: ',i
end if
read(1,*,iostat=ierr) j
if(ierr.eq.6100) then
print*, 'error reading integer*2 was: ',ierr
else
print*, 'integer*2 input: ',j
end if
read(1,*,iostat=ierr) k
if(ierr.eq.6100) then
print*, 'error reading integer*4 was: ',ierr
else
print*, 'integer*4 input: ',k
end if
end
|
Additional reference words: 1.00 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |