Whenever a calculation is done and the result might fit into a SmallInteger instance - you get a SmallInteger instance. Otherwise a LargeInteger is created. As you might notice, LargeInteger class is defined as "variableLongSubclass ..." the values therefore are stored in an array holding "long" values - all that stored within the instance.
How many long words the instace needs to store its value can be retrieved by calling "#size" against the instance and the single values can be retrieved by executing aLargeIntegerInstance basicAt: anIndex, where 0 < anIndex <= aLargeIntegerInstance size.
Marten
gsharma84 wrote:HI,
I typed a very large number and when I inspected it, it came out to be a Large Number Object. In Java I guess the number is converted into exponential notation, not sure though.
My question is how does Smalltalk create such large numbers? Though the code is there, but would be better if one can direct me to a doc or so. I want to explore the architectural differences also..