Update of /project/movitz/cvsroot/movitz/losp/muerte In directory common-lisp.net:/tmp/cvs-serv19168
Modified Files: integers.lisp Log Message: Remember to return the remainder also, when implementing truncate on negatives in terms of truncate on positives.
Date: Wed Jul 14 05:28:06 2004 Author: ffjeld
Index: movitz/losp/muerte/integers.lisp diff -u movitz/losp/muerte/integers.lisp:1.57 movitz/losp/muerte/integers.lisp:1.58 --- movitz/losp/muerte/integers.lisp:1.57 Wed Jul 14 05:16:28 2004 +++ movitz/losp/muerte/integers.lisp Wed Jul 14 05:28:06 2004 @@ -9,7 +9,7 @@ ;;;; Created at: Wed Nov 8 18:44:57 2000 ;;;; Distribution: See the accompanying file COPYING. ;;;; -;;;; $Id: integers.lisp,v 1.57 2004/07/14 12:16:28 ffjeld Exp $ +;;;; $Id: integers.lisp,v 1.58 2004/07/14 12:28:06 ffjeld Exp $ ;;;; ;;;;------------------------------------------------------------------
@@ -1434,11 +1434,17 @@ (setf q (+ q guess) r (- r (* divisor guess)))))))))) (((integer * -1) (integer 0 *)) - (- (truncate (- number) divisor))) + (multiple-value-bind (q r) + (truncate (- number) divisor) + (values (- q) (- r)))) (((integer 0 *) (integer * -1)) - (- (truncate number (- divisor)))) + (multiple-value-bind (q r) + (truncate (- number) divisor) + (values (- q) r))) (((integer * -1) (integer * -1)) - (truncate (- number) (- divisor))) + (multiple-value-bind (q r) + (truncate (- number) divisor) + (values q (- r)))) ))))
(defun / (number &rest denominators)