guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

integer-length on negative bignum


From: Kevin Ryde
Subject: integer-length on negative bignum
Date: Sun, 04 May 2003 09:55:52 +1000
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux)

A small bug in integer-length, assuming I understand what that
function is meant to be doing.  This lets it correspond to the inum
case at least.

        * numbers.c (scm_integer_length): On negative bignums, adjust
        mpz_sizeinbase to account for it looking at absolute value where we
        want ones-complement.

        * tests/numbers.test (integer-length): Exercise some negatives, in
        particular "...11100..00".

In the tests here, it's only ...11100..00 which is affected by the
problem, the others are already right, I just added them for coverage
and confirmation of what integer-length does.

Attachment: numbers.c.integer-length.diff
Description: Text document

Attachment: numbers.test.integer-length.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]