Class 6: Bit Shifting Flashcards
1
Q
A & C
A = 1010
C = 0000
A
0000
2
Q
A = false
C = true;
A && C
A
False
3
Q
A |C
A = 1010
C = 0001
A
1011
4
Q
XOR a ^ c
A = 1010
C = 0000
A
1010
5
Q
Left shifting
A
Shifts bits to the left and fill in with 0’s
6
Q
Arithmetic right shift
A
Fills in from the left with copy of most significant bit
Preserves sign of value
Used when interpreting value fo B2T
7
Q
Right shift logical
A
Fills in from the left with 0’s
Used when interpreting binary value as B2U
8
Q
Relational operator
A
Used to compare two values
9
Q
Do arithmetic operators have higher precedence than relational
A
YES
10
Q
Short Circuit Evaluation
A
Relational statements stop evaluating once a statements value if DEFINITIVE
11
Q
Type casting
A
(Type)
12
Q
0 is treated as_____
A
FALSE
13
Q
Non-zero is treated as _____
A
TRUE