Skip to content
  • Raymond Toy's avatar
    Make sure floating-point exceptions are signaled. · 258101b2
    Raymond Toy authored
    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.
    258101b2