Changeset 12940
 Timestamp:
 10/02/10 21:39:52 (13 years ago)
 Location:
 trunk/abcl/src/org/armedbear/lisp
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/abcl/src/org/armedbear/lisp/Complex.java
r12431 r12940 79 79 { 80 80 return imagpart; 81 } 82 83 /** Coerces the complex parts into DoubleFloats 84 * 85 * @return a new complex with doublefloat real and imaginary parts 86 */ 87 public LispObject coerceToDoubleFloat() { 88 return getInstance(DoubleFloat.coerceToFloat(realpart), 89 DoubleFloat.coerceToFloat(imagpart)); 81 90 } 82 91 
trunk/abcl/src/org/armedbear/lisp/MathFunctions.java
r12922 r12940 624 624 // for anything not a rational or complex rational, use 625 625 // float approximation. 626 boolean wantDoubleFloat = false; 627 if (base instanceof DoubleFloat) 628 wantDoubleFloat = true; 629 else if (power instanceof DoubleFloat) 630 wantDoubleFloat = true; 631 else if (base instanceof Complex 632 && (((Complex)base).getRealPart() instanceof DoubleFloat 633  ((Complex)base).getImaginaryPart() instanceof DoubleFloat)) 634 wantDoubleFloat = true; 635 else if (power instanceof Complex 636 && (((Complex)power).getRealPart() instanceof DoubleFloat 637  ((Complex)power).getImaginaryPart() instanceof DoubleFloat)) 638 wantDoubleFloat = true; 639 640 if (wantDoubleFloat) { 641 if (power instanceof Complex) 642 power = ((Complex)power).coerceToDoubleFloat(); 643 else 644 power = DoubleFloat.coerceToFloat(power); 645 646 if (base instanceof Complex) 647 base = ((Complex)base).coerceToDoubleFloat(); 648 else 649 base = DoubleFloat.coerceToFloat(base); 650 } 651 652 653 626 654 if (base instanceof Complex  power instanceof Complex) 627 655 return exp(power.multiplyBy(log(base)));
Note: See TracChangeset
for help on using the changeset viewer.