From: Jim Freeze Date: 2003-02-06T07:16:03+09:00 Subject: Re: Error in Complex On Thursday, 6 February 2003 at 7:08:37 +0900, Martin DeMello wrote: > Daniel Carrera wrote: > > Hello, > > > > There seems to be a problem in Complex. It gets (-i)^2/3 wrong. > > > > 2/3 > > i = 1/2 + sqrt(3)/2 > > > > 2/3 > > (-i) = - 1 > > -i = exp(-i * pi/2) > (-i)^(2/3) = (1)^2/3 * exp(-i * pi/2 * 2/3) > = exp(-i * pi/3) > = cos(pi/3) - i sin(pi/3) > = 1/2 - sqrt(3)/2 > > martin require 'complex' => true irb(main):005:0> Complex(0.0,1.0)**(2.0/3.0) => Complex(0.5000000000000001, 0.8660254037844386) Looks ok to me. -- Jim Freeze ---------- Egotist, n.: A person of low taste, more interested in himself than me. -- Ambrose Bierce, "The Devil's Dictionary"