小编Ada*_*yes的帖子

作为输出参数的函数

我想创建一个子程序,将函数作为输出返回.我怎样才能做到这一点?我会举一个例子,说明我认为它应该如何(我知道它写的很糟糕)

module fun_out

contains

subroutine exponential(F,a)
     interface, intent(out)

        function f(x)
         real, intent(in)::x
         real :: f(2)
        end function
     end interface
     real,intent(in):: a

   F=exp(a*x)

end subroutine exponential

end module
Run Code Online (Sandbox Code Playgroud)

有了这个,我应该从输出中的指数族中获取一个函数.

fortran function output

7
推荐指数
1
解决办法
336
查看次数

标签 统计

fortran ×1

function ×1

output ×1