floating point exceptions: be more ansi-compliant

signal exceptions on underflows, overflows, division by zero etc.
This commit is contained in:
Daniel Kochmański 2016-12-06 12:45:38 +01:00
parent 626f4829bb
commit e6fcb5b7a8
2 changed files with 4 additions and 3 deletions

View file

@ -1361,9 +1361,9 @@ install_fpe_signal_handlers()
if (ecl_option_values[ECL_OPT_TRAP_SIGFPE]) {
mysignal(SIGFPE, fpe_signal_handler);
si_trap_fpe(ECL_T, ECL_T);
# ifdef ECL_IEEE_FP
/* By default deactivate errors and accept
* denormals in floating point computations */
# if 0 /* defined(ECL_IEEE_FP) */
/* By default deactivate errors and accept denormals
* in floating point computations. */
si_trap_fpe(@'floating-point-invalid-operation', ECL_NIL);
si_trap_fpe(@'division-by-zero', ECL_NIL);
si_trap_fpe(@'floating-point-overflow', ECL_NIL);

View file

@ -398,6 +398,7 @@ The top-level loop of ECL. It is called by default when ECL is invoked."
(in-package "CL-USER")
(unless (or *lisp-initialized* (null process-command-line))
(si:trap-fpe :last t)
(process-command-args)
(format t "ECL (Embeddable Common-Lisp) ~A (git:~D)"
(lisp-implementation-version)