[Vm-dev] positive32BitValueOf: fail with LargePositiveInteger

stephane ducasse stephane.ducasse at gmail.com
Sat Oct 9 20:30:03 UTC 2010


Thanks dave!

>> 
>> So....I don't understand...how can I have a LargePositiveInteger but that is
>> less than 32 bits?  Wouldn't that  be a SmallInteger?
> 
> SmallInteger maxVal hex ==> '16r3FFFFFFF'.
> 
> The largest positive two-compliment integer that fits into 32 bits is
> 16rEFFFFFFF, so any Integer in the range 16r4000000 through 16rEFFFFFFF
> is a LargePositiveInteger that can fit into a signed 32-bit C int.
> 
> Thus the number of LargePositiveInteger values that fit into a 32-bit
> twos-compliment representation is (16r4000000 to: 16rEFFFFFFF) size ==> 3959422976
> 
> Note that a SmallInteger is represented internally as a 31-bit value,
> which accounts for the difference. It's a bit confusing when you are used
> to thinking of 32-bit int values.
> 
> Dave
> 



More information about the Vm-dev mailing list