Numerics Was: bit shifting
mike at twinsun.com
Tue Apr 14 22:13:35 UTC 1998
> >It seems to me that the real question is one of context. If your playing with
> >a chunk of bits, then you expect a bit op on said chunk to affect *every*
> >bit. If you're playing with an Integer, then you expect the sign to be
> >respected, after all, the fact that computers steal a high (or low) bit to
> >indicate sign is kind of a grand elegant hack anyway. ...
> Note that Common Lisp has both Integers and BitVectors. I don't mean to
> derail Smalltalk standards, but there has been a large interest in doing
> 'the right thing' numerically in CL and a huge amount of numerical code
> written. I think that in this area it is good to reuse the intellectual
> investment in CL (and Scheme! 8^) numerics.
I agree. It would also be nice if
being false was deprecated. I.E.
#strictlyPositive => #isPositive
#positive => #isNonnegative
It would also be nice if we had the exact vs. inexact numbers distinction
from Scheme. There is no reason, in principle, that Smalltalk's numerics
couldn't be as good as, (and, in fact, reuse the intellectual investment in)
CL & Scheme.
BTW: ANSI Smalltalk does not get bit operations wrong for negative numbers
since it says the result is undefined. Being silent ~= being wrong.
-- Mike Klein
More information about the Squeak-dev