Silverfrost Logo About Us | Contact Us

Common sub-expressions

In most cases, common sub-expressions are evaluated only once. Thus the following code could not be improved by the prior assignment TEMP=X*Y:

Z = (X*Y)/(1.0+X*Y)

Common sub-expressions may sometimes be evaluated more than once in character expressions and in arithmetic expressions contained in logical IF statements.



Copyright © 1999-2018 Silverfrost Limited