From: Paul F. D. <di...@dl...> - 2003-08-19 12:05:22
|
(ceiling -100 100) ==> 1, 0 ;; good (ceiling -536870912 536870912) ==> 0, -536870912 ;; oops This occurs both in cmucl (8/1/2003 linux image) and sbcl (current cvs). Paul |
From: Paul F. D. <di...@dl...> - 2003-08-19 12:09:51
|
I wrote: > (ceiling -100 100) ==> 1, 0 ;; good Make that -1, of course. Paul |
From: Gerd M. <ger...@t-...> - 2003-08-19 12:23:30
|
"Paul F. Dietz" <di...@dl...> writes: > (ceiling -100 100) ==> 1, 0 ;; good > > (ceiling -536870912 536870912) ==> 0, -536870912 ;; oops > > This occurs both in cmucl (8/1/2003 linux image) and sbcl (current > cvs). Thanks. The bug is in truncate. Since I don't think this is performance critical... --- numbers.lisp.~1.47.~ Thu Aug 7 12:31:42 2003 +++ numbers.lisp Tue Aug 19 14:20:35 2003 @@ -652,7 +652,7 @@ (numerator divisor)))) (values q (- number (* q divisor))))) ((fixnum bignum) - (values 0 number)) + (bignum-truncate (make-small-bignum number) divisor)) ((ratio (or float rational)) (let ((q (truncate (numerator number) (* (denominator number) divisor)))) |