This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[gfortran] error in results
- From: tcc at sentex dot net
- To: fortran at gcc dot gnu dot org
- Date: Sun, 12 Oct 2003 16:13:03 -0400
- Subject: [gfortran] error in results
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