3 ms·
a = 1111 0000 0000 1111 1111 0000 0000 1111 a << 37 == a << (37 % 32) == a << 5 == 0000 0001 1111 1110 0000 0001 1110 0000 a >> (32 - (37 % 32)) == a
by nostrebored 12y ago
a = 1111 0000 0000 1111 1111 0000 0000 1111
a << 37 == a << (37 % 32) == a << 5
== 0000 0001 1111 1110 0000 0001 1110 0000
a >> (32 - (37 % 32)) == a >> 27
== 0000 0000 0000 0000 0000 0000 0001 1110
anding the two together you get
== 0000 0001 1111 1110 0000 0001 1111 1110
which is a circular rotation of the bit string...
- thaumasiotes 12y ago0 & 1 is not 1, it's 0. 0000 0001 1111 1110 0000 0001 1110 0000 & 0000 0000 0000 0000 0000 0000 0001 1110 ----------------------------------------- 0000 0000 0000 0000 0000 0000 0000 0000
- nostrebored 11y agoYou're right! My bad. Definitely meant to | it.