Introduction to expressions and assignment

An expression is a data reference or a computation, and is formed from operands, operators, and parentheses. An expression, when evaluated, produces a value, which has a declared type, a dynamic type, a shape, and possibly type parameters.

An operand is either a scalar or an array. An operator is either intrinsic or defined. A unary operation has the form:
  • operator operand
A binary operation has the form:
  • operand1 operator operand2
Any expression contained in parentheses is treated as a data entity. Parentheses can be used to specify an explicit interpretation of an expression. They can also be used to restrict the alternative forms of the expression, which can help control the magnitude and accuracy of intermediate values during evaluation of the expression. For example, the two expressions
    (I*J)/K
    I*(J/K)
are mathematically equivalent, but may produce different computational values as a result of evaluation.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us