[gfortran] error in results

Paul Brook paul@nowt.org
Mon Oct 13 22:42:00 GMT 2003


On Sunday 12 October 2003 9:13 pm, tcc@sentex.net wrote:
> The following code produces erroneous results.
> Hth,
> Douglas Cox

Fixed.

Paul

>  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



More information about the Fortran mailing list