in reply to Re: Implementing a signed/sign-propagating right bitwise shift
in thread Implementing a signed/sign-propagating right bitwise shift
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Implementing a signed/sign-propagating right bitwise shift
by ikegami (Patriarch) on Feb 16, 2012 at 17:57 UTC | |
|
Re^3: Implementing a signed/sign-propagating right bitwise shift
by jethro (Monsignor) on Feb 16, 2012 at 18:01 UTC | |
by LonelyPilgrim (Beadle) on Feb 16, 2012 at 18:29 UTC |