Raymond Toy pushed to branch issue-473-make-cr-exp-signal-underflow at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/lisp/irrat.c
    ... ... @@ -197,6 +197,17 @@ double
    197 197
     lisp_exp(double x)
    
    198 198
     {
    
    199 199
     #ifdef FEATURE_CORE_MATH
    
    200
    +    /*
    
    201
    +     * For consistency, silently return NaN when x is NaN.  Do not
    
    202
    +     * signal an invalid operation, even if invalid operation trap is
    
    203
    +     *  enabled.  This is what fdlibm does, and also what many of the
    
    204
    +     *  other core-math routines do.
    
    205
    +     */
    
    206
    +
    
    207
    +    if (isnan(x)) {
    
    208
    +	return x;
    
    209
    +    }
    
    210
    +    
    
    200 211
         /*
    
    201 212
          * Can't depend on cr_exp to signal underflow.  It seems the
    
    202 213
          * underflow has been constant-folded to zero.  Hence, check for