hi all, i'm a complete newbie to fortran - if someone can take 30 seconds to look at the short code below and tell me why it prints the wrong sum of two numbers, i'd be very gratefull, because i'm freaking out already...
CODE:
program temp
implicit none
real,external :: add
real :: y
y = add(3,4)
print *,y
end program temp
real function add(x,n)
implicit none
real, intent(in) :: x
real, intent(in) :: n
add = x+n
end function add
OUTPUT:
9.8090893E-45
Press any key to continue
any ideas?????
CODE:
program temp
implicit none
real,external :: add
real :: y
y = add(3,4)
print *,y
end program temp
real function add(x,n)
implicit none
real, intent(in) :: x
real, intent(in) :: n
add = x+n
end function add
OUTPUT:
9.8090893E-45
Press any key to continue
any ideas?????