[Bug-openmcl] corner case
Gary Byers
gb at clozure.com
Wed Jan 14 21:00:23 MST 2004
On Wed, 14 Jan 2004, bryan o'connor wrote:
> (truncate (- (1+ MOST-POSITIVE-FIXNUM) (1+ MOST-POSITIVE-FIXNUM)))
>
> which is:
>
> (truncate MOST-NEGATIVE-FIXNUM (1+ MOST-POSITIVE-FIXNUM))
>
> i'm guessing you know about this case from this line in
> l0-numbers.lisp:
> (if (eq divisor most-negative-fixnum) ;; << aargh
>
> i don't begin to grok BIGNUMs yet, so i have no fix.
>
>
> ...bryan
I think that it was Alice Hartley (of Digitool) who deserves credit
for the "; << aargh".
We can't use the general BIGNUM-TRUNCATE-BY-FIXNUM routine for the
case of (TRUNCATE bignum fixnum) when the fixnum is MOST-NEGATIVE-FIXNUM.
A similar "; << aargh" probably belongs on the case of:
(TRUNCATE fixnum divisor)
when the fixnum is MOST-NEGATIVE-FIXNUM.
Just to confuse things further, TRUNCATE's second return value may
be expensive to compute, so TRUNCATE looks up the stack to see
if its caller expects multiple values and calls TRUNCATE-NO-REM if
it doesn't; this means that there are twice as many ways to go wrong
(and there appear to be a few more "; << aargh"s to add ...)
More information about the Bug-openmcl
mailing list