who ever performed bit logic on large negative integer?
Stephan Rudlof
sr at evolgo.de
Sat Jan 26 15:28:04 UTC 2008
On 26.01.2008 16:07, Paolo Bonzini wrote:
>> There should be a comment somewhere (Integer class comment?)
>> explicitly stating, that you cannot rely on two complement semantics
>> for LargeNegativeIntegers regarding bit logic (bit logic restricted to
>> positive Integers is correct).
>
> That's absurd IMHO.
It's just warning of the current limitations.
>
>> I fear, changing the fundamental design decision to use magnitude
>> representation for LargeNegativeIntegers - e.g. by introducing some
>> kind of two complement representation - would imply a lot of work...
>
> It is possible to work out bitwise ops on magnitude representation, by
> computing the two's complement representation on the fly in the
> primitives or in the fallback Smalltalk code.
OK, another - better - way to go: should be much less work than changing the representation.
Stephan
>
> Paolo
>
>
--
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
|