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

Oh, then the perl man page I consulted is deficient: perldoc -f vec says "This must be a power of two from 1 to 32". But a quick test shows that you are right

Replies are listed 'Best First'.
Re^4: [NOT] How would you decode this?
by Corion (Patriarch) on Dec 28, 2010 at 16:11 UTC

    24 is not really a power of two :)

      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

Re^4: [NOT] How would you decode this?
by BrowserUk (Patriarch) on Dec 28, 2010 at 16:11 UTC

    24 isn't a power of 2.