Slowly, please. :-) Bitwise anything is new to me, and I struggle with even understanding what it means.
Yes, I can see how (1 << $firstbit) is a constant. But its purpose is to get at that first bit, 0b10000000000000000000000000000000, i.e. 2**31. What is a better way to do that? I originally had "2**$firstbit" in place of "(1 << $firstbit)". Would that be better here? Is that what you mean by 'extracting' it?
As for your second paragraph, you'll have to slow down and explain how to do what you're saying, as you lost me completely with everything beginning with "checking the high-bit."
In any case, thanks!
In reply to Re^2: Implementing a signed/sign-propagating right bitwise shift
by LonelyPilgrim
in thread Implementing a signed/sign-propagating right bitwise shift
by LonelyPilgrim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |