If arithmetic operators are used, the result of an expression is derived by the application of the operators to the value of the operands.
Arithmetic operators must not be applied to character strings. Thus, USER + 2 is invalid.
The two types of arithmetic operators are prefix operators and infix operators.
The prefix operator + (unary plus) does not change its operand.
The prefix operator - (unary minus) reverses the sign of its operand. For example, if the data type of A is small integer, then the data type of -A is large integer.
The first character of the token following a prefix operator must not be a plus or minus sign. For example, --10 is not allowed since 10 is preceded by two minus signs.
Note: Unary operators are not allowed with FLOAT, REAL and DOUBLE PRECISION data types.
The infix operators and the operation they specify are:
Operator |
Operation |
---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
/ |
Division |
The operand of an infix operator must not be a function that includes the keyword DISTINCT.
The value of the second operand of division must not be zero.
Copyright © 2014 CA.
All rights reserved.
|
|