segmentation fault created by fortran if tests

后端 未结 1 982
长情又很酷
长情又很酷 2020-12-11 06:28

Suppose I have the following code

    IF (a.eq.0.or.M(a)) THEN

With a an integer and M(1:3) an array of logicals. If a is equal to 0, then

相关标签:
1条回答
  • 2020-12-11 07:06

    Fortran allows for, but does not guarantee, short-circuit evaluation of logical operators. So to be safe, you will have to write your code under the assumption that each operand is evaluated.

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