44
Bitwise-And (&) Operator
The bitwise-and operator performs the logical AND operation bit by bit between two integers. This is
better understood by looking at the example of
12&10
. The binary value of
12
is
1100
, and the binary
value of
10
is
1010
.
12&10
is computed by performing an AND between each of the corresponding
four bits:
12:
1 1 0 0
10:
1 0 1 0
12&10: 1 0 0 0
Therefore:
12&10 = (Hex) 1000 = (Decimal) 8
Bitwise-Or (|) Operator
The bitwise-or operator performs the logical AND operation bit by bit between two integers. This is
better understood by looking at the example of
12|10
. The binary value of
12
is
1100
, and the binary
value of
10
is
1010
.
12I10
is computed by performing an OR between each of the corresponding four
bits:
12:
1 1 0 0
10:
1 0 1 0
12|10: 1 1 1 0
Therefore:
12|10= (Hex) 1110 = (Decimal) 14
Bitwise-Not (~) Operator
The bitwise-not prefix operator performs the logical NOT to each bit od an integer. This is better
understood by looking at the example of
~5
. The binary value of
5
is
101
.
~5
is computed by
performing a NOT on each of the three bits:
5:
1
0
1
~5:
0
1
0
Therefore:
~5 = (Hex) 010 = (Decimal) 2
Содержание CRM-WIC
Страница 1: ...Reference Manual Programming Guide Room Monitor Web Intelligent Controller Model CRM WIC...
Страница 7: ...7 Box Contents Box Contents for the CRM WIC Web Intelligent Controller Model CRMWIC Power Adapter...
Страница 8: ...8 Hardware User Interface Hardware User Interface for the CRM WIC...
Страница 16: ...16 For full details see the RPC section at the end of this manual...
Страница 43: ...43 This expression resolves to this value 0 1 4 3 1 Hello Hello 0...
Страница 98: ...98 Index...