4 ms·
Python does have bit shifting, for what it's worth.
by gtaylor 10y ago
Python does have bit shifting, for what it's worth.
- r_smart 10y agoHmmmm...I don't remember what I was thinking then. I remember wanting to use something more typically low level, like bit shifting, and it either being way too much hassle or not supported. Either way, thanks for the correction.
- knicholes 10y ago>>> 1 << 4 16
- chocolatebunny 10y agoThe big problem I've had with Python and bit shifting has just been dealing with negative numbers. Python doesn't have a concept of unsigned ints, or even just 32bit numbers so I end up having to mask everything by 0xFFFFFFFF. Not really a big deal but maybe that's the issue you were running into?
- r_smart 10y agoThat sounds like it might have been the case. I probably got annoyed and just did it a different way. I'm not really sure though. It's one of those things where it happened awhile ago and made an impression on me, but the details have long since faded, leaving only my opinion :)