counting matching bits / bitXnor

Cees de Groot cdegroot at gmail.com
Mon Dec 17 16:32:23 UTC 2007


I *understand* it, but it's not what I *want* :).

(granted, "expect" is not the right word)

On Dec 17, 2007 5:05 PM, Paolo Bonzini <bonzini at gnu.org> wrote:
> Cees de Groot wrote:
> > On Dec 17, 2007 1:49 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> >>> 0 bitXnor: 0 -> -1
> >> And what exactly is wrong with that?
> >>
> > err... I'd expect '1' here?
>
> No.  If you have arbitrary-precision integers, numbers like "infinitely
> many ones plus something else" are negative; numbers like "infinitely
> many zeros plus something else" are positive.  0 is infinitely many
> zeros, -1 is infinitely many ones -- and XNORing each of the infinitely
> many zeros with itself produces infinitely many ones, right?
>
> The problem is that your bitstrings have a length beyond which all bits
> should be considered zeros; integers have not.
>
> I hope this is understandable...
>
> Paolo
>
>
>



-- 
"Human beings make life so interesting. Do you know, that in a
universe so full of wonders, they have managed to invent boredom. " -
Death, in "The Hogfather"



More information about the Squeak-dev mailing list