Syntax error when using caret for exponentiation

后端 未结 1 1643
夕颜
夕颜 2020-12-04 03:44

When I do:

   REAL FUNCTION  f(x)          
      REAL, INTENT(IN) :: x
      f = exp(-x)
    END FUNCTION  f 

it works but if I do:

相关标签:
1条回答
  • 2020-12-04 04:31

    Use x ** 2 to exponentiate. Or x*x in this case.

    0 讨论(0)
提交回复
热议问题