[movitz-cvs] CVS update: movitz/losp/muerte/integers.lisp
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Wed Jul 14 13:53:16 UTC 2004
Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv20715
Modified Files:
integers.lisp
Log Message:
In ceiling, calculate correct remainder.
Date: Wed Jul 14 06:53:16 2004
Author: ffjeld
Index: movitz/losp/muerte/integers.lisp
diff -u movitz/losp/muerte/integers.lisp:1.60 movitz/losp/muerte/integers.lisp:1.61
--- movitz/losp/muerte/integers.lisp:1.60 Wed Jul 14 06:48:11 2004
+++ movitz/losp/muerte/integers.lisp Wed Jul 14 06:53:16 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.60 2004/07/14 13:48:11 ffjeld Exp $
+;;;; $Id: integers.lisp,v 1.61 2004/07/14 13:53:16 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -1509,7 +1509,9 @@
(defun ceiling (number &optional (divisor 1))
(case (+ (if (minusp number) #b10 0)
(if (minusp divisor) #b01 0))
- (#b00 (truncate (+ number divisor -1) divisor))
+ (#b00 (multiple-value-bind (q r)
+ (truncate (+ number divisor -1) divisor)
+ (values q (- r (1- divisor)))))
(t (error "Don't know."))))
(defun rem (dividend divisor)
More information about the Movitz-cvs
mailing list