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]

[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


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