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

October 2025

S M T W T F S
    1 23 4
5 678 9 1011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 12th, 2025 04:41 am
Powered by Dreamwidth Studios