Skip to content
Snippets Groups Projects
Commit 258101b2 authored by Raymond Toy's avatar Raymond Toy
Browse files

Make sure floating-point exceptions are signaled.

The compiler sometimes constant folds operations so that
floating-point exceptions are not signaled.  However, lisp and other
applications (maxima) currently expects these exceptions to be
signaled.  Make this happen by using feraiseexcept to force these
signals when they are enabled.  If feraiseexcept does not raise an
exception (because it is masked), we return the appropriate value.

Only a few files have been updated to support this. More work needed.

 * src/lisp/setexception.c:
   * New file. This is used by the routines to signal an appropriate
     exception or return the appropriate value. Uses feraiseexcept to
     do this, which should be available on all supported platforms.
 * src/lisp/GNUmakefile:
   * Add setexception.c to list of files to compile and link into
     lisp.
 * src/lisp/e_cosh.c:
   * Update to use the new routine.to signal exceptions.
 * src/lisp/e_sinh.c:
   * Update to use the new routine.to signal exceptions.
 * tests/trig.lisp:
   * Add tests to make sure exceptions are thrown for cosh and sinh. 
   * Add tests to make sure that the correct value is returned when
     the floating point exception is masked.
parent c5f98ef9
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment