Conrad C-Control Pro Mega Series Manual page 104

Table of Contents

Advertisement

95
C-Control Pro Mega Series
*
/
%
-
5.2.5.2
Bit Operators
Bit operators are only allowed for Integer data types
Operator
&
|
^
~
5.2.5.3
Bit-Shift Operators
Bit-Shift operators are only allowed for Integer data types. With a Bit-Shift operation a
be moved into one end.
Operator
<<
>>
5.2.5.4
In- /Decrement Operators
Incremental and decremental operators are only allowed for variables with Integer data types.
Multiplication
Division
Modulo
Negative Sign
Description
And
Or
exclusive Or
Bit inversion
Description
shift to left
shift to right
5 * 4
7 / 2
7.0 / 2
15 % 4
17 % 2
-(2+2)
Example
0x0f & 3
0xf0 & 0x0f
1 | 3
0xf0 | 0x0f
0xff ^ 0x0f
0xf0 ^ 0x0f
~0xff
~0xf0
Example
1 << 2
3 << 3
0xff >> 6
16 >> 2
20
3
3.5
3
1
-4
Result
3
0
3
0xff
0xf0
0xff
0
0x0f
0
will always
Result
4
24
3
4
© 2008 Conrad Electronic

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the C-Control Pro Mega Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

C-control pro mega32C-control pro mega128

Table of Contents