Skip to content

Commit 50211a7

Browse files
committed
Updated bits readme
1 parent 51cfe39 commit 50211a7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/com/rampatra/bits/README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@
3232

3333
### Shifts
3434

35+
_Disclaimer: We are taking `byte` (8 bits) as our datatype to explain the
36+
concepts instead of the usual integer._
37+
3538
#### 1. Left Shift (<<):
3639

3740
1 << 3 = 8
3841

39-
> 00000001 << 3 = 00001000 (only showing 8 bits)
42+
> 00000001 << 3 = 00001000
4043
4144
#### 2. Right Shift:
4245

@@ -58,7 +61,6 @@
5861

5962
> 001000000 >>> 2 = 00010000
6063
61-
-64 >>> 2 =
64+
-64 >>> 2 = 56
6265

63-
> 111000000 >>> 2 = 00010000
64-
66+
> 111000000 >>> 2 = 00111000

0 commit comments

Comments
 (0)