[Ecls-list] Error: Cannot print object #<single-float quiet NaN> readably.
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Mon Dec 19 19:50:44 UTC 2011
On Mon, Dec 19, 2011 at 7:00 PM, Waldek Hebisch <hebisch at math.uni.wroc.pl>wrote:
> Put the the following line in a file:
>
> (DEFUN |nangenericcomplex| () (PROG () (RETURN (/ 1.0 (COMPLEX 0.0)))))
>
> And then try to compile-file it:
>
> > (compile-file "sfsfun.clisp")
>
> ;;; Loading #P"/var/tmp/hebisch/usr/lib/ecl-11.1.1/cmp.fas"
> ;;;
> ;;; Compiling sfsfun.clisp.
> ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
> ;;;
> ;;; Compiling (DEFUN |nangenericcomplex| ...).
> ;;; End of Pass 1.
> ;;; Emitting code for |nangenericcomplex|.
> ;;; Internal error:
> ;;; ** Cannot print object #<single-float quiet NaN> readably.
> NIL
> NIL
> NIL
>
> FriCAS uses such a function to raise floating point errors
> when appropriate. In principle I could divide by "runtime"
> zero (I have one at hand as just before call to |nangenericcomplex|
> I have test which checks that number to be used as divisor is zero).
> But having separate function seems clearer. And some day compiler
> may be smart enough to realize that "runtime" zero is a zero and
> try to constant fold it...
Actually this is the time in which ECL is already clever enough to
constant-fold the #'/ and detect that the output of that function can not
be saved. Changing the function to
(DEFUN foo () (PROG () (locally (declare (notinline /)) (RETURN (/ 1.0
(COMPLEX 0.0))))))
fixes the problem, because ECL no longer tries to precompute the quotient.
I am unsure about how to fix this, or even whether this needs to be fixed...
Juanjo
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20111219/1a9a7b8d/attachment.html>
More information about the ecl-devel
mailing list