Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


5.4 Priority of conditional and arithmetic operations

Priority applies to the following operators that can be used in the let command:

The table below shows the priority of conditional expressions and arithmetic operations in descending order of priority level, where 1 is the highest priority. Operations are performed in descending order of the priority, starting from the highest.

Table 5‒30: Priority of operators

Priority

Operator

1

- (unary minus operator), !, ++, --, ~

2

**

3

*, /, %

4

+, -

5

<<, >>

6

<, <=, >, >=

7

==, !=

8

&

9

^

10

|

11

&&

12

||

13

?: (ternary operator)

14

=, +=, -=, *=, /=, %=, &=, ^=, |=, <<=, >>=

In the example shown below, 3**3 is calculated first because ** has a higher priority than *. As a result, the value 54 is assigned to a and 54 is output to the standard output.

let a=2*3**3   <-- 3 to the power of 3 is multiplied by 2
echo $a        <-- 54 is output as the value of a to the standard output