IBM 15 Switch User Manual


 
132
Chapter 8
Operation Comments Precedence (se
e next section)
&&
Used between two integers. The result
is the bitwise ‘and’ of the integers INT1
and INT2.
4
&&~~
Used between two integers. The result
is th e bitwise ‘and’ of INT1 and the
bitwise complement of INT2.
4
||
Used between two integers. The result
is th e bitwise ‘inclusive or’ of INT1
and INT2.
4
~~
Used in front of an i nteger. Produces
the bitwise complement of INT.
4
||/&
Used between two integers. The result
is th e bitwise ‘exclusive or’ of INT1
and INT2.
4
INT1 << N
Used between two integers. Produces
the bit pattern of INT shifted left by N
positions.
4
INT1 >> N
Used between two integers. Produces
the bit patt ern of INT shifted right by
N positions.
4
/
Used to divide one number by another:
NUM1 / NUM
2.
4
**
Used between two numbers: BASE **
POWER. Returns BASE raised to the
power P O WER.
3
rem
Used between two integers: INT1 rem
INT2. Returns th e remainder, INT1 -
(INT1 div INT2) * INT2.
2
div
Used between two integers: INT1 div
INT2. Performs integer division.
2
Operator Precedence
Precedences determine the parsing of complex expressions, especially unbracketed expressions
with more than one inx operator. For example,
3 + 4 * 5
parses as 3 + (4 * 5) rather than (3 + 4) * 5 because the relative precedences dictate that * is to be
parsed before +. Every operator in the CLEM language has a precedence value associated with it;
the lower this value, the more important it is on the parsing list, meaning that it will be proces sed
sooner than other operators with higher precedence values.