132
Chapter 8
Operation Comments Precedence(see next section)
&& Used between two integers. The result
isthe bitwise ‘and’ of theintegers INT1
and INT2.
4
&&~~ Used between two integers. The result
is the bitwise ‘and’ of INT1 and the
bitwise complement of INT2.
4
|| Used between two integers. The result
is the bitwise ‘inclusive or’ of INT1
and INT2.
4
~~ Used in front of an integer. Produces
theb itwise complement of INT.
4
||/& Usedb etween two integers. The result
is the bitwise ‘exclusive or’ of INT1
and INT2.
4
INT1<< N Used between two integers. Produces
theb it pattern of INT shifted left by N
positions.
4
INT1>> N Used between two integers. Produces
the bit pattern of INT shifted right by
N positions.
4
/Used to divide one number by another:
NUM1 / NUM2.
4
** Used between two numbers: BASE **
POWER. Returns BASE raised to the
power POWER.
3
rem Used between two integers: INT1 rem
INT2. Returns the 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 expressionswith 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 beparsed before +. Every operator in the CLEM language has a precedence value asso ciated with it;the lower this value, the more important it is on the parsing list, meaning that it will be processedsooner than other operators with higher precedence values.