Numerics Was: bit shifting

Mike Klein mike at twinsun.com
Wed Apr 15 20:10:56 UTC 1998


> >BTW: ANSI Smalltalk does not get bit operations wrong for negative numbers
> >since it says the result is undefined.  Being silent ~= being wrong.
> 
> OK, it doen't get the operations wrong, but IMHO remaining silent on a
> topic like this _is_ wrong. 

I disagree.

The whole idea of a "sign bit" for mathematical integers is flawed.

Zero is not a positive integer.  Look at any math book from the last
several centuries.  It was only after computers came around did binary
even become interesting, let alone two's complement.

Maybe we should all start using Church numerals :-)  Or maybe Roman numbers.

Why should negative numbers have bit operations?  Why not bit operations
on Fractions and Floats?

I think the disagreement on the subject indicates that ANSI did the right thing
by being silent on bit operations for negative numbers.

I think later, there should be a larger numerics extension, done with
Scheme-Like care.

-- Mike Klein





More information about the Squeak-dev mailing list