[FIX] IntegerFromBytesFix-sr
Richard A. O'Keefe
ok at cs.otago.ac.nz
Fri Sep 6 02:31:42 UTC 2002
Stephan Rudlof <sr at evolgo.de> pointed out that
unpacking SmallInteger maxVal and trying to put the bytes back together
with Integer>>byte1:byte2:byte3:byte4: gives you a LargePositiveInteger
instead of a SmallInteger, and provided a correction.
On looking at #byte1:byte2:byte3:byte4:, I see a documentation problem.
The comment doesn't explain whether it is supposed to construct a
*signed* 4-byte integer or an *unsigned* 4-byte integer.
Could I ask for a change to the comment as well, so that it reads
"Answer an integer in the range 0 to 2**32-1,
given its base-256 digits (byte4 byte3 byte2 byte1).
The result is a SmallInteger if possible, otherwise a LargeInteger.
Only the most significant byte needs to be checked to decide which."
More information about the Squeak-dev
mailing list
|