[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: small integers



> Date: Sat, 10 Oct 92 02:33:59 -0400
> From: Scott_Fahlman@SEF-PMAX.SLISP.CS.CMU.EDU
> ....  At times you
> seem to favor the "correct" Common Lisp approach, and at other times you
> seem to accept the idea of an overflow error under certain conditions.

I think I have consistently said that I favor an overflow error when it is a
type error, that is, when it can be shown that if a bignum were created from 
the overflow it would cause a type error before the next observable 
side-effect.

I think (but I'm not sure about this part) that an overflow in the middle of
a complex arithmetic expression can often be shown either to cause an overflow
at the end (and thus we can reason backwards that it is a type error) or be
handled by using increased precision for the intermediate results in the
arithmetic expression, without going beyond the precision the machine 
supports.  Think about (* (+ x y) z) where we know they are all small integers 
and z is not 0 or -1, and the result is being fed to something that only 
accepts small integers.

More later.