[Vm-dev] positive32BitValueOf: fail with LargePositiveInteger

Bert Freudenberg bert at freudenbergs.de
Fri Oct 8 21:21:25 UTC 2010


On 08.10.2010, at 10:12, Mariano Martinez Peck wrote:

> Hi. I am trying to call #primitiveBitOr which inside calls #popPos32BitInteger which calls  #positive32BitValueOf , with two LargePositiveInteger. Example:
> 
> 9999999999 bitOr: 8888888888.
>     
> Now, this seems to fail since the #bitOr: of LargePositiveInteger is failing, and thus, super (Integer) is being used. Now, I don't understand why it fails. 

Because 9999999999 does not fit into 32 bits. 

> So....I don't understand...how can I have a LargePositiveInteger but that is less than 32 bits?  Wouldn't that be a SmallInteger?

SmallIntegers are 31 bits. Positive SmallIntegers are 30 bits:

	SmallInteger maxVal
		1073741823

You *really* should start learning about the Squeak VM basics first.

- Bert -




More information about the Vm-dev mailing list