[FIX] SmallInteger class comment
David N. Smith (IBM)
dnsmith at watson.ibm.com
Sun Sep 9 21:28:06 UTC 2001
This was once submitted as a [BUG] and with no [FIX].
The class comment in SmallInteger states:
My instances are 30-bit numbers, stored in twos complement form. The allowable
range is approximately +- 1 billion (see SmallInteger minVal, maxVal).
which is wrong. The virtual machine uses a one bit tag to indicate that the rest of the 32 bit object pointer is a SmallInteger which means that the instances of SmallInteger are 31-bits in length. One can also write code to check this maximum; it also indicates a 31-bit length for SmallIntegers.
The comment should be fixed. Attached is code to change the comment to:
My instances are 31-bit numbers, stored in twos complement form. The allowable
range is approximately +- 2 billion (see SmallInteger minVal, maxVal).
(This is another contribution for most trivial bug fix.)
Dave
-------------- next part --------------
Skipped content of type multipart/appledouble
More information about the Squeak-dev
mailing list
|