Jul. 26th, 2011

Math q

Jul. 26th, 2011 09:24 am
izard: (Default)
It's been a while since I was not able to find an answer to a technical question in google. Usually I can find anything, the key is to know part of the answer.

Now my math skills are lagging.

I have a 32 bit unsigned number. I need to check if bit N (11 < N < 22) is set when a number is divided by 3. The trick is I don't want to do a division and would like to know if I can construct a bitmask for each N which checks the bit using only bit ops.

I have a hunch that a method exists, but not sure studying which area of math may help.

Profile

izard: (Default)
izard

October 2025

S M T W T F S
   1234
567891011
12131415161718
19202122232425
26 272829 3031 

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 30th, 2025 11:47 pm
Powered by Dreamwidth Studios