UD70
Issue code: 70nu2
4-6 DPL programming
Operators for integer variables only
& Logic AND AB Y
000
010
100
111
5 & 14 = 4
| Logic OR
AB Y
000
01 1
101
111
5 | 14 = 15
Logic XOR AB Y
000
01 1
101
110
5 & 14 = 11
!Value
Bit invert
This Operator inverts the least-significant bit, and converts all
other bits to zero.
Example
1001000 (binary) is converted to 0000011 (binary)
!(value, bit-field-size)
Bit-field invert
This Operator inverts the specified number of least significant
bits, and converts all other bits to zero. The bitbit-field-field-size-size
specifies the number of least-significant bits that are to be
converted.
Example
Result% = !(value%, 3)
100100100 (binary) is converted to 000011011 (binary).
%
Remainder
This Operator gives the remainder when an integer is divided
by another integer.
Example
5 % 2 = 1
8 % 3 = 2