# HG changeset patch # User Paul Eggert # Date 744956057 0 # Node ID 45e3868140f14efde06610605f6c1d3cedbdc5ee # Parent 95b9760d19e359bdf79b66f227944f00a8deeb2f (floor*): Use `floor' instead of doing most the work ourselves. diff -r 95b9760d19e3 -r 45e3868140f1 lisp/emacs-lisp/cl-extra.el --- a/lisp/emacs-lisp/cl-extra.el Tue Aug 10 04:14:17 1993 +0000 +++ b/lisp/emacs-lisp/cl-extra.el Tue Aug 10 04:14:17 1993 +0000 @@ -387,19 +387,8 @@ (defun floor* (x &optional y) "Return a list of the floor of X and the fractional part of X. With two arguments, return floor and remainder of their quotient." - (if y - (if (and (integerp x) (integerp y)) - (if (and (>= x 0) (>= y 0)) - (list (/ x y) (% x y)) - (let ((q (cond ((>= x 0) (- (/ (- x y 1) (- y)))) - ((>= y 0) (- (/ (- y x 1) y))) - (t (/ (- x) (- y)))))) - (list q (- x (* q y))))) - (let ((q (floor (/ x y)))) - (list q (- x (* q y))))) - (if (integerp x) (list x 0) - (let ((q (floor x))) - (list q (- x q)))))) + (let ((q (floor x y))) + (list q (- x (if y (* y q) q))))) (defun ceiling* (x &optional y) "Return a list of the ceiling of X and the fractional part of X.