Numerics Was: bit shifting
Lex Spoon
lex at cc.gatech.edu
Thu Apr 16 17:20:12 UTC 1998
Wim Boot writes:
> Mike Klein wrote:
>
> >> >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.
>
[examples deleted]
> This works for all integers and is completely independent of
> representation. Common two's complement hardware only allows
> for a very efficient implentation of these operations.
But what is a bit, when you are talking about numbers? Just the fact
of having bits at all means the VM is promissing bit-style behavior to
an application. (Of course, the VM is free to implement it any way it
wants internally).
Lex
More information about the Squeak-dev
mailing list
|