-
- Downloads
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.
Showing
- src/lisp/GNUmakefile 2 additions, 1 deletionsrc/lisp/GNUmakefile
- src/lisp/e_cosh.c 9 additions, 3 deletionssrc/lisp/e_cosh.c
- src/lisp/e_sinh.c 8 additions, 2 deletionssrc/lisp/e_sinh.c
- src/lisp/fdlibm.h 8 additions, 0 deletionssrc/lisp/fdlibm.h
- src/lisp/setexception.c 55 additions, 0 deletionssrc/lisp/setexception.c
- tests/trig.lisp 49 additions, 5 deletionstests/trig.lisp
Loading
Please register or sign in to comment