-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators
More file actions
59 lines (31 loc) · 706 Bytes
/
operators
File metadata and controls
59 lines (31 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
1. assignment
var a = 10;
2. bitwise: and & , or |, (xor exclusive-or) ^
3. logical: or ||, and &&
4. shift: << , >>
5. arithmetic: + = * / %
6. unary: post++ post-- --pre ++pre !
7. relational: > < >= <= == === !=
8. ternary: ()?isTrue:isFalse
20: 1 0 1 0 0
20 = (2^4 * 1) + (2^3 * 0) + (2^2 * 1) + ..
126 = (10^2 *1) + (10^1 * 2) + (2^0* 6)
20/2 : 0
10/2 : 0
5/2 : 1
2/2 : 0
1
30: 16 + 8 + 4 + 2 + 0 : 11110
33: 32 + 0 + 0+ 0+ 0+ 1 : 100001
21: 16 + 0+ 4 + 0+ 1 : 10101
20: 10100
30: 11110
&: 10100
|: 11110
20: 010100
33: 100001
&: 000000
|: 110101 : 32+ 16+ 4+ 1
1. even or odd using &
2. network protocols
& and &&: performance hit?