<div dir="ltr"><div><div><div><div><div><div><div>I am using Squeak 3.11. I assume the same results apply to Squeak 4.4. If not, my apologies.<br><br>In Squeak if I evaluate:<br><br>1) ((2 << 256) bitAnd: (2 << 128)) ==> 0<br>
2) ((2 << 256) bitAnd: (2 << 128)) class ==> SmallInteger<br></div>3) (2 << 128) ==> 680564733841876926926749214863536422912<br></div><div>4) ((2 << 128) bitAnd: (2 << 128)) ==> 680564733841876926926749214863536422912<br>
<br></div>This all looks correct and I care because I need to do <bitAnd:> of some largePositiveIntegers.<br><br></div>But <LargePositiveInteger>>BitAnd:> is:<br><br></div>"Primitive. Answer an Integer whose bits are the logical AND of the<br>
receiver's bits and those of the argument. Fail if the receiver or argument<br> is greater than 32 bits. See Object documentation whatIsAPrimitive."<br> <primitive: 14><br> self halt. "I ADDED THE HALT"<br>
^ super bitAnd: anInteger<br></div><br></div>The way I see it <LargePositiveInteger>>BitAnd:> is always going to fail and thus invoke its super version<br></div><div>(<LargePositiveInteger>>BitAnd:>) and this is what I see when I run the code; i.e. I hit the halt.<br>
<br>So why have <LargePositiveInteger>>BitAnd:> method at all?<br><br></div><div>Ditto for the other bit operations.<br><br></div><div>Ralph Boland<br></div></div>