I think the function haipart in clmacs.lisp is buggy.
Actually there are two definitions in there: the one that is active is
buggy, and the one that works is commented out because it is
supposedly slower. But that one is the right one. The currently active
one gives wrong values for negative count arguments e.g.
(haipart 10 -2) gives 0 though it should be 2.
I enabled the correct one (commented out the bad one) and everything
seems to be fine. Especially the jacobi symbol in numth.lisp is now
working correctly.
This should be corrected in the CVS.
Just for the record, the correct definition is:
(defun haipart (integer count)
(let ((x (abs integer)))
(if (minusp count)
(ldb (byte (- count) 0) x)
(ldb (byte count (max 0 (- (integer-length x) count))) x))))
Andreas
PS: I think I will go over all the numbertheoretic functions and
correct them, because most are not working properly (see the comment
on primep in the mailing list).
But don't hold yout breath :-)
--
Wherever I lay my .emacs, there´s my $HOME.