[squeak-dev] bitshift:
Tim Olson
tim.olson.mail at gmail.com
Fri Dec 11 20:16:23 UTC 2015
On Dec 11, 2015, at 2:00 PM, Frank Lesser <frank-lesser at lesser-software.com> wrote:
> Hi,
>
> ( -16r100000001 bitShift: -32 ) = -2
> ( -16r100000000 bitShift: -32 ) = -1
>
> looks odd to me,
>
> guess the prim needs to be fixed
Looks correct to me:
(-16r100000001 bitAnd: 16rFFFFFFFFFF) hex -> ‘16rFEFFFFFFFF’
downshift this by 32 bits and you get 16rFFFFFFFE, which is -2
(-16r100000000 bitAnd: 16rFFFFFFFFFF) hex -> ‘16rFF00000000'
downshift this by 32 bits and you get 16rFFFFFFFF, which is -1.
— tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20151211/cbb59397/attachment.htm
More information about the Squeak-dev
mailing list
|