1.4
Priority of arithmetic operation
Operations are performed in the following order of priority. When two operations of equal priority
appear in the same statement, the operations are executed in order from left to right.
Priority Rank
1
2
3
4
5
6
7
8
9
10
11
12
13
1.5
Data format conversion
Data format is converted in cases where two values of different formats are involved in the same
operation.
1.
When a real number is assigned to an integer, decimal places are rounded off.
Examples: A%=125.67
2.
When integers and real numbers are involved in the same operation, the result
becomes a real number.
Examples: A(0)=125 * 0.25
3.
When an integer is divided by an integer, the result is an integer with the remainder
discarded.
Examples: A(0)=100/3
Arithmetic Operation
Expressions included in parentheses
Functions, variables
^ (exponents)
Independent "+" and "-" signs (Monominal operators)
* (Multiplication), / (Division)
MOD
+ (Addition), - (Subtraction)
Relational operators
NOT, ~ (Logical NOT)
AND, & (Logical AND)
OR, |, XOR (Logical OR, exclusive OR)
EQV (Logical equivalence)
IMP (Logical implication)
→
→
→
A%=126
A(0)=31.25
A(0)=33
Arithmetic operations
1
2
3
4
5
6
4-3