[r6rs-discuss] [Formal] bitwise-bit-count should return -ve on -ve argument.

From: Ben Harris <bjh21>
Date: Tue, 24 Apr 2007 11:36:48 +0100 (BST)

On Mon, 23 Apr 2007, Alan Bawden wrote:

> Date: Mon, 23 Apr 2007 23:50:04 +0100 (BST)
> From: Ben Harris <bjh21 at bjh21.me.uk>
> Cc: discuss at r6rs.org
>
> Ah, yes, I think I got carried away with the cuteness of the idea and
> didn't bother to check it was actually true.
>
> And it is a cute idea. My hat's off to you for having the original
> inspiration!

I can't take credit for the original idea -- it was suggested to me by
Simon Tatham.

> You want symmetry? I'll give you symmetry... Under the revised definition
> (bitwise-not (bitwise-bit-count x)) is equal to
> (bitwise-bit-count (bitwise-not x))!

Ooh, yes, that's neat.

-- 
Ben Harris
Received on Tue Apr 24 2007 - 06:36:48 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC