Steven Nunez via Sbcl-help <
sbcl...@lists.sourceforge.net> writes:
> arithmetic error FLOATING-POINT-INVALID-OPERATION signalled
> Operation was (> #<DOUBLE-FLOAT quiet NaN> #<DOUBLE-FLOAT quiet NaN>).
> [Condition of type FLOATING-POINT-INVALID-OPERATION]
> It almost looks like the compiler is trying to do a comparison. double-float-nan is defined as a constant and I've confirmed it's properly loaded.
> Any ideas?
The compiler is probably trying to do a comparison, attempting to do
type derivation or constant-folding or something similar. This is a
bug, but fixing it might involve auditing the current type derivers to
make sure that they are NaN-aware (and so might be a more substantial
piece of work than can be done quickly).
Some possible workarounds:
* around compiling, turn floating-point traps off:
(let ((modes (sb-int:get-floating-point-modes)))
(unwind-protect
(progn (set-floating-point-modes :traps nil) (compile-your-things))
(apply 'sb-int:set-floating-point-modes modes)))
* disguise the NaN constant from the compiler:
use `(load-time-value double-float-nan)` in place of the bare `double-float-nan`
Best wishes,
Christophe
_______________________________________________
Sbcl-help mailing list
Sbcl...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help