ZHCADY9A April 2024 – January 2025 LM73 , LM75B , LM95071 , TMP100 , TMP101 , TMP102 , TMP103 , TMP104 , TMP107 , TMP1075 , TMP108 , TMP112 , TMP114 , TMP116 , TMP117 , TMP121 , TMP122 , TMP123 , TMP124 , TMP126 , TMP144 , TMP175 , TMP1826 , TMP1827 , TMP275 , TMP400 , TMP401 , TMP411 , TMP421 , TMP422 , TMP423 , TMP431 , TMP432 , TMP435 , TMP451 , TMP461 , TMP464 , TMP468 , TMP4718 , TMP75 , TMP75B , TMP75C
/* right shift */
unsigned char x = 0x23;
unsigned char y = x >> 4;
/* y is 0x02 */
/* mask to discard bits */
unsigned char z = x & 0xF;
/* z is 0x03 */
A | B | C | |
---|---|---|---|
1 | 23 | =HEX2DEC(A1) | =INT(B1*2^-4) |
2 | 23 | =HEX2DEC(A2) | =BITAND(B2,HEX2DEC("F")) |
A | B | C | |
---|---|---|---|
1 | 23 | 35 | 2 |
2 | 23 | 35 | 3 |
/* JavaScript */
/* right shift */
let x = 0x23
let y = x >> 4
/* y is 0x2 */
/* mask to discard bits */
let z = x & 0xF
/* z is 0x3 */
# Python
# right shift
x = 0x23
y = x >> 4
# y is 0x2
# mask to discard bits
z = x & 0xF
# z is 0x3