Changeset 3566
 Timestamp:
 09/03/03 23:55:48 (19 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/j/src/org/armedbear/lisp/Complex.java
r3562 r3566 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Complex.java,v 1.1 3 20030902 20:02:44piso Exp $5 * $Id: Complex.java,v 1.14 20030903 23:55:48 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 132 132 LispObject c = ((Complex)obj).getRealPart(); 133 133 LispObject d = ((Complex)obj).getImaginaryPart(); 134 // xy = (ac  bd) + i(ad + bc) 135 // real part = ac  bd 136 // imag part = (a + b)(c + d)  ac  bd 134 137 LispObject ac = a.multiplyBy(c); 135 138 LispObject bd = b.multiplyBy(d); … … 170 173 public LispObject ABS() throws TypeError 171 174 { 172 floatreal = LispFloat.coerceToFloat(realpart).getValue();173 floatimag = LispFloat.coerceToFloat(imagpart).getValue();174 return new LispFloat( (float)Math.sqrt(real * real + imag * imag));175 double real = LispFloat.coerceToFloat(realpart).getValue(); 176 double imag = LispFloat.coerceToFloat(imagpart).getValue(); 177 return new LispFloat(Math.sqrt(real * real + imag * imag)); 175 178 } 176 179
Note: See TracChangeset
for help on using the changeset viewer.