module的一个问题,请大虾提示
很简单的一个程序,怎么就不对呢f(x)=e^(-x)
想根据输入x,得到f(x)的值和它的导数值,下面是我写的程序,调试时提示:
C:\Program Files\Microsoft Visual Studio\MyProjects\iterative_solution1\ex4.f90(13) : Error: The name of the module procedure conflicts with a name in the encompassing scoping unit. [FUNC2]
function func2(x)
请各位帮忙看看吧,多谢了
module simple_iter
implicit none
interface
function func2(x)
implicit none
real :: x
real :: func2(2)
end function
end interface
contains
function func2(x)
implicit none
real,intent(in):: x
real :: func2(2)
func2(1)=exp(-x)
func2(2)=-exp(-x)
return
end function
end module
program main
use simple_iter
implicit none
real :: x0
write(*,*) "Please input x0:"
read(*,*) x0
!call func2(x0)
write(*,"(2f6.2)") func2(x0)
stop
end 语句太乱
页:
[1]