int x = 0xfff;
Hex 0xfff
Bin 0000 0000 0000 0000 0000 1111 1111 1111 (32bit)
Hexadecimal → Binary → Bit Operation → Hexadecimal
~x : fffff000
x<<4 : fff0 move left, fill blank 0
x>>4 : ff move right, fill blank 0
-1 >> 4 : ffffffff (eight f) → fill blank 0
-1 >>> 4 : fffffff (seven f) → fill blank 1
Hex 0xfff
Bin 0000 0000 0000 0000 0000 1111 1111 1111 (32bit)
Hexadecimal → Binary → Bit Operation → Hexadecimal
~x : fffff000
x<<4 : fff0 move left, fill blank 0
x>>4 : ff move right, fill blank 0
-1 >> 4 : ffffffff (eight f) → fill blank 0
-1 >>> 4 : fffffff (seven f) → fill blank 1
JAVA Bit Operator
Reviewed by kukanuc
on
7월 22, 2018
Rating:
댓글 없음: