[FIX] IntegerFromBytesFix-sr

Stephan Rudlof squeak-dev at lists.squeakfoundation.org
Fri Sep 6 13:16:52 UTC 2002


Richard,

I think you are able to read thoughts: I've just sitted in front of my
computer and had similar thoughts.

So...

Richard A. O'Keefe wrote:
> 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."

your wish is like a command for me ;-)

I have just posted an updated changeset.


Greetings,

Stephan

> 
> 
> 
> 


-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3




More information about the Squeak-dev mailing list