我有一个非常小的Fortran代码示例,我想了解一下。
subroutine test_iso_c
use ISO_C_BINDING
implicit real(c_double) (a-h,o-z)
real :: var, expression
interface
real(c_double) function test (y) bind( c )
use ISO_C_BINDING
real(c_double), value :: y
end
end interface
! call
var = test(expression) ! - expression is a real declared variable which is calculated using simple arithmetic operation.
end
您能否向我解释以下内容(我假设c_double表示C代码范围内的双精度?)
1-implicit real(c_double) (a-h,o-z)
是什么?
2-{{1}}和value
在功能界面中做什么
3-我将此代码视为较大例程的一部分,您能说一下此测试功能提供/执行的操作吗?