2
;;;; Author: Paul Dietz
3
;;;; Created: Thu Aug 28 11:23:40 2003
4
;;;; Contains: Auxiliary functions for testing the multiplication operator *
8
(defun integer-times (x y)
14
(let ((result (nat-times x y)))
15
(if neg (- result) result))))
17
(defun nat-times (x y)
21
(let ((lo (if (oddp x) y 0))
22
(hi (nat-times (ash x -1) y)))
25
(defun rat-times (x y)
26
(/ (integer-times (numerator x) (numerator y))
27
(integer-times (denominator x) (denominator y))))