
14 Jul
2014
14 Jul
'14
3:59 a.m.
Am 13.07.2014 21:49, schrieb Eric Mertens:
I think defining the behavior of shifts to work modulo the bitSize is no better than leaving those ranges undefined. If we were going to define what it means to shift outside that range I'd rather it was somehow consistent with math multiplying and dividing by powers of two than randomly rolling over to a world where shifting a Word32 by 33 somehow corresponds to shifting by 1.
What he actually wants, is (x `testBit` mod n 64). I guess "rotate" is the better than "shift" here because "rotate" is naturally modular.