Changeset 11713


Ignore:
Timestamp:
03/19/09 16:13:39 (13 years ago)
Author:
ehuelsmann
Message:

Fix ACOS with complex argument.

Found by: Robert Dodier through the Maxima test suite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/MathFunctions.java

    r11488 r11713  
    169169        }
    170170        LispObject result = new DoubleFloat(Math.PI/2);
    171         if (!(arg instanceof DoubleFloat))
    172             result = new SingleFloat((float)((DoubleFloat)result).value);
     171        if (!(arg instanceof DoubleFloat)) {
     172            if (arg instanceof Complex &&
     173                    ((Complex)arg).getRealPart() instanceof DoubleFloat) {
     174                    // do nothing; we want to keep the double float value
     175            }
     176            else
     177                result = new SingleFloat((float)((DoubleFloat)result).value);
     178        }
    173179        result = result.subtract(asin(arg));
    174180        if (result instanceof Complex) {
Note: See TracChangeset for help on using the changeset viewer.