summaryrefslogtreecommitdiff
path: root/mpz
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-10-02 03:09:00 +0200
committerKevin Ryde <user42@zip.com.au>2001-10-02 03:09:00 +0200
commit40231d09bb8a764a5618b67e33d976b5bd80ee85 (patch)
tree937886aea5252fc562a59de80fc985ff1ce34966 /mpz
parent2ae6fad8b30a45dfe42a302f6cab074039b56034 (diff)
downloadgmp-40231d09bb8a764a5618b67e33d976b5bd80ee85.tar.gz
Corrections to a couple of comments from:
* mpz/hamdist.c: Support neg/neg operands.
Diffstat (limited to 'mpz')
-rw-r--r--mpz/hamdist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mpz/hamdist.c b/mpz/hamdist.c
index 5bdbc8884..2c26934b6 100644
--- a/mpz/hamdist.c
+++ b/mpz/hamdist.c
@@ -93,7 +93,7 @@ mpz_hamdist (mpz_srcptr u, mpz_srcptr v)
}
}
- /* twos complement for non-zero limbs (ulimb is non-zero, but vlimb
+ /* twos complement first non-zero limbs (ulimb is non-zero, but vlimb
might be zero) */
ulimb = -ulimb;
vlimb = -vlimb;
@@ -148,7 +148,8 @@ mpz_hamdist (mpz_srcptr u, mpz_srcptr v)
vp += step;
}
- /* Remaining high part of u or v, if any, ones complement. */
+ /* Remaining high part of u or v, if any, ones complement but xor
+ against all ones in the other, so plain popcount. */
if (usize != 0)
{
remaining: