Apr. 1st, 2009

juan_gandhi: (Default)
You probably know how to clear the lsb in a word, right?

Now, imagine the word (or an int, or a long, whatever) is split into pairs of bits. How the hell can I clear the last non-zero pair?

E.g.

0 -> 0
1 -> 0
2 -> 0
3 -> 0
4 -> 4
5 -> 4
6 -> 4
7 -> 4
...
0xfe000 -> 0xfc000
...
juan_gandhi: (Default)
Ну типа джипиэс какой-нибудь у вас, типа гармина, или просто на телефоне; и вы приехали на Северные Фиджи.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 16th, 2025 11:25 pm
Powered by Dreamwidth Studios