

Arithmetic Expressions › Coding Considerations
Coding Considerations
The following considerations apply to coding arithmetic expressions:
- An arithmetic expression must begin with a left parenthesis, a unary operator, or an operand.
- An arithmetic expression must end with a right parenthesis or an operand.
- An arithmetic expression does not require a binary operation.
- Each left parenthesis must be followed later in the expression by a corresponding right parenthesis.
- Operands and binary operators must be separated by at least one space from the operand or operator that follows. Parentheses do not require surrounding spaces.
- Operands can be followed by a right parenthesis, any binary operator, or can be the end of the expression.
- Any binary operator can be followed by an operand, a unary operator, or a left parenthesis.
- A unary operator can be followed by an operand or a left parenthesis.
- A left parenthesis can be followed by an operand, a unary operator, or another left parenthesis.
- A right parenthesis can be followed by any binary operator, another right parenthesis, or can be the end of the expression.
Copyright © 2014 CA.
All rights reserved.
 
|
|