in reply to Re^3: [NOT] How would you decode this?
in thread [NOT] How would you decode this?

24 is not really a power of two :)

Replies are listed 'Best First'.
Re^5: [NOT] How would you decode this?
by jethro (Monsignor) on Dec 28, 2010 at 16:13 UTC
    Ah right, I was thinking about the cutoff point being at 2^24 and that is a power of two. Really self-evident ;-)) Doh
      Since at the end you have to use an AND anyway to cut off the 2 flag-bits you could use a negative offset of 8 bits and mask 10 bits of a 2**5=32 bit vec without loss of speed!

      Flags 01234567|FF|ddddddddddddddddddddd 32 bit Vector -8 bits | | 22 bits Data 00000000|00|111111111111111111111 Mask

      Cheers Rolf