# Using Parentheses in Numeric Expressions

You can use parentheses to force a particular order of evaluation. When part of an expression is enclosed in parentheses, that part is evaluated first. The resulting value is used in the evaluation of the remainder of the expression.

# Data Type of Numeric Expressions

If every operand in a numeric expression is of the same data type, the result is also of that type.

If operands of different data types are combined in an expression, the evaluation of that expression and the data type of the resulting value depend on the ranking associated with each data type. The following table shows the ranking assigned to each data type:

# Character Expressions

A character expression consists of a character operator (//) that concatenates two operands of type character. The evaluation of a character expression produces a single value of that type.

# Relational Expressions

A relational expression consists of two or more expressions whose values are compared to determine whether the relationship stated by the relational operator is satisfied. The following are relational operators:

# Logical Expressions

A logical expression consists of one or more logical operators and logical, numeric, or relational operands. The following are logical operators:

# Defined Operations

When operators are defined for functions, the functions can then be referenced as defined operations.

The operators are defined by using a generic interface block specifying OPERATOR, followed by the defined operator (in parentheses).

A defined operation is not an intrinsic operation. However, you can use a defined operation to extend the meaning of an intrinsic operator.

# Summary of Operator Precedence

The following table shows the precedence of all intrinsic and defined operators:

# Initialization and Specification Expressions

An initialization expression is an expression that is evaluated when a program is compiled. It can be used as a kind type parameter, a named constant, or to specify an initial value for an entity.

# Initialization Expressions

An initialization expression is an expression that you can use as a kind type parameter, a named constant, or to specify an initial value for an entity. It is evaluated when a program is compiled.

In an initialization expression, each operation is intrinsic and each primary is one of the following:

# Specification Expressions

A specification expression is a restricted scalar integer expression that you can use in specifications such as length type parameters and array bounds.

In a restricted expression, each operation is intrinsic and each primary is one of the following: