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

CLTL compatible type contagion?

I asked about this before, and the answer was no, clisp does not do
type contagion as specified in CLTL2.  The current behavior is to
convert everything to the smallest floating-point type instead of the
largest as most other languages typically do and as specified by CLTL.
Some sensible reasons for this are given in impnotes.txt.

However, I was doing some numerical prototyping with clisp and came
across this very annoying problem with the current type contagion:

	(+ 1d50 1.0)

does not return 1d50.  Instead, it signals a floating-point overflow.
I presume that clisp does the addition in double-float and then
coerces the result to single-float, causing the overflow.

This behavior makes numerical work more difficult than it
should be.

Does anyone know where the routines are that cause this behavior?  I'd
like to change it in my own copy of clisp.  I tried looking through
the source, but I don't read German.

Thanks for any pointers,