Jump to content

Talk:Short-circuit evaluation: Difference between revisions

m
Line 59:
* However, in ''Z = F(X) . AND. G(Y)'', if ''F(X)'' has side effects that change the value of ''G(Y)'', this is not standard conformant: ''The evaluation of a function reference shall neither affect nor be affected by the evaluation of any other entity within the statement.'' (7.1.8)
 
Therefore, you cantcan't rely on short-circuiting in Fortran, and you have to use a nested IF, as Paddy3118 remarks. Even if one particular Fortran compiler guarantees short-circuit evaluation (maybe with a command-line option), using this feature would not affect standard conformance of the program, but it could certainly affect its successful execution with other compilers.
 
[[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 10:27, 30 April 2015 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.