FORTRAN77 Arithmetic Expressions
Note:The order of evaluation of an expression is:
Note: An expression does not have to be evaluated fully if its value can be determined otherwise: for example the result of:
X * FUNC(G)
can be determined without calling the function FUNC if X happens to be zero. This will not cause problems if you only use functions that have no side effects.(Like short-circute of ||)
A Fortran system is not required to evaluate every term in a logical expression completely if its value can be determined more simply.
- sub-expressions in parentheses
- function references
- exponentiation, i.e. raising to a power
- multiplication and division
- addition, subtraction, or negation.
Note: An expression does not have to be evaluated fully if its value can be determined otherwise: for example the result of:
X * FUNC(G)
can be determined without calling the function FUNC if X happens to be zero. This will not cause problems if you only use functions that have no side effects.(Like short-circute of ||)
A Fortran system is not required to evaluate every term in a logical expression completely if its value can be determined more simply.
评论
发表评论