[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bignum bug?
- To: (BUG LISP) at MIT-MC
- Subject: Bignum bug?
- From: FH at MIT-MC (Fred W. Helenius)
- Date: Mon, 22 Sep 80 00:44:00 GMT
- Original-date: 21 SEP 1980 2044-EDT
If you compile the following function (which is intended to add two
rational numbers given in the form (numerator . denominator)), load
it into LISP, and do (eval exp) where exp is given below, LISP produces
the error still further below:
(defun add-rats (a b)
(let (((c . d) a)
((e . f) b))
(let ((hcf (gcd d f)))
(cons (plus (times c (quotient f hcf))
(times e (quotient d hcf)))
(times (quotient d hcf) f)))))
(setq exp
'(apply 'add-rats '((716087101460491 . 1041496283283456)
(103334765625 . 197568495616))))
;(7577) NON-NUMERIC VALUE
;BKPT WRNG-TYPE-ARG
I suppose this is a bug. The function works fine in the interpreter,
and compiled for most arguments. For your convenience, the function
definition, the result of its compilation, and the definition of exp
may be found in FH;BUG DEFN, BUG FASL, and BUG EXP, respectively.