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

November 2025

S M T W T F S
       1
2345678
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Nov. 1st, 2025 05:02 pm
Powered by Dreamwidth Studios