AW: [squeak-dev] bitshift:

Frank Lesser frank-lesser at lesser-software.com
Fri Dec 11 21:22:01 UTC 2015


Hi Tim, thx for fast answer, need to get sorted my newsgroups as it was
posted wrong.

It is wrong in Dolphin:

 

( -16r10000001 bitShift: -32 )-1

( -16r10000000 bitShift: -32 )-1

( -16r1000001 bitShift: -24 ) -2

( -16r1000000 bitShift: -24 ) -1

 

but according to Dolphin's comment it is correct.

Frank

 

  _____  

Von: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] Im Auftrag von Tim
Olson
Gesendet: Freitag, 11. Dezember 2015 21:16
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] bitshift:

 

 

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/268c9fd8/attachment.htm


More information about the Squeak-dev mailing list