[gfortran] error in results
tcc@sentex.net
tcc@sentex.net
Sun Oct 12 20:18:00 GMT 2003
The following code produces erroneous results.
Hth,
Douglas Cox
module arrz
contains
function z(a_in,d) result (aout)
integer :: d
real :: a_in(d),aout(d)
aout = a_in*2.0 + 1.0
end function z
end module arrz
program testz
use arrz
real, dimension(4) :: a = (/ 1.,2.,3.,4. /), b
integer :: d = 4
b = z(a,d)
print*, b
end
Output:
1.000000 1.000000 1.000000 1.000000
ifc:
3.000000 5.000000 7.000000 9.000000
More information about the Fortran
mailing list