Subject: bug#14863: bitwise-bit-count is wrong for negative arguments

From: Göran Weinholt <[email-masked]>
Date: Tue, 16 Jul 2013 16:08:07 +0200

Mark H Weaver <[email-masked]> writes:

> Göran Weinholt <[email-masked]> writes:
>
>> the bitwise-bit-count procedure from (rnrs) is wrong for negative
>> arguments in Guile 2.0.9:
>>
>> scheme@(guile-user)> (import (rnrs))
>> scheme@(guile-user)> (bitwise-bit-count #b-101)
>> $1 = 1
>>
>> The correct result is -2.
>
> Indeed, thanks for the report.  Now fixed on the stable-2.0 branch.
>
> http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=e8f329972666db6c9d4644619473e14d54db3a80

I just discovered that fxbit-count has the same bug.

Regards,

-- 
Göran Weinholt <[email-masked]>
20             JUSTICE KENNEDY:  That seems odd.  I mean,
21 Microsoft doesn't say please buy our disk because it's
22 the prettiest disk in the business.