* Jens Nyberg <jens.nyb...@gmail.com> [2013-07-15 16:51:29 +0200]: > Hehe and I almost thought about changing to (x & 0x3f) instead of (x % 64) > but decided to skip that one =) >
note that x&63 and x%64 x>>6 and x/64 x<<6 and x*64 are not the same when x might be negative (if x is negative then x&63 depends on the signed int representation, but guaranteed to be in [0,63] while x%64 is in [-63,0], x>>6 is implementation defined and usually very different from x/64 and x<<6 is undefined while x*64 is only undefined when it overflows) so the compiler (and you) can only interchange these freely if it can be proven that x cannot be negative (eg because its type is unsigned)