[squeak-dev] Integer arithmetic and bit operations in Squeak and Pharo (32bit & 64bit)

tim Rowledge tim at rowledge.org
Sat Jan 7 17:57:37 UTC 2017


> On 06-01-2017, at 11:59 PM, Benoit St-Jean <bstjean at yahoo.com> wrote:
> 
> 3) I was surprised to find out that SmallInteger>>#maxVal wasn't a constant (or the same on both VM).  It's (1<<60)-1 on the 64bit VM and (1<<30)-1 on the 32bit VM.  So, be warned if your code depends on SmallInteger>>#maxVal for some reason!
> 

Since the bit size of a SmallInteger is by definition constrained by the word size of the VM, I can’t see why anyone would be surprised by this. SmallInteger is a machine detail specific trick to get basic integer maths to run as fast as we can. One could make a system without it. 

> 
> 4) Is there any rationale/reason/explanation as to why, in Pharo, LargePositiveInteger inherits from the class LargeInteger (which doesn't exist in Squeak) ?
> 
 A simple matter of factoring preferences. Unless there is a mistake in the refactoring it won’t have any substantial effect.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- Teflon brain -- nothing sticks.




More information about the Squeak-dev mailing list