[armedbear-cvs] r11731 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sat Apr 4 22:22:07 UTC 2009


Author: ehuelsmann
Date: Sat Apr  4 18:22:06 2009
New Revision: 11731

Log:
Share code already abstracted out elsewhere (use OverUnderFlowCheck()).

Modified:
   trunk/abcl/src/org/armedbear/lisp/MathFunctions.java

Modified: trunk/abcl/src/org/armedbear/lisp/MathFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/MathFunctions.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/MathFunctions.java	Sat Apr  4 18:22:06 2009
@@ -510,18 +510,10 @@
         if (arg.realp()) {
             if (arg instanceof DoubleFloat) {
                 double d = Math.pow(Math.E, ((DoubleFloat)arg).value);
-                if (TRAP_OVERFLOW && Double.isInfinite(d))
-                    return error(new FloatingPointOverflow(NIL));
-                if (d == 0 && TRAP_UNDERFLOW)
-                    return error(new FloatingPointUnderflow(NIL));
-                return new DoubleFloat(d);
+                return OverUnderFlowCheck(new DoubleFloat(d));
             } else {
                 float f = (float) Math.pow(Math.E, SingleFloat.coerceToFloat(arg).value);
-                if (TRAP_OVERFLOW && Float.isInfinite(f))
-                    return error(new FloatingPointOverflow(NIL));
-                if (f == 0 && TRAP_UNDERFLOW)
-                    return error(new FloatingPointUnderflow(NIL));
-                return new SingleFloat(f);
+                return OverUnderFlowCheck(new SingleFloat(f));
             }
         }
         if (arg instanceof Complex) {




More information about the armedbear-cvs mailing list