From: "Hal E. Fulton" Date: 2003-02-06T07:24:40+09:00 Subject: Re: Error in Complex ----- Original Message ----- From: "Hal E. Fulton" To: "ruby-talk ML" Sent: Wednesday, February 05, 2003 4:19 PM Subject: Re: Error in Complex > ----- Original Message ----- > From: "Martin DeMello" > Newsgroups: comp.lang.ruby > To: "ruby-talk ML" > Sent: Wednesday, February 05, 2003 4:08 PM > Subject: Re: Error in Complex > > > > 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 > > OK, I admit I'm showing my ignorance here. > How do you reconcile that with: > > (-i)**(2/3.0) > ((-i)**2)**3.0) > (-1)**3.0 > -1 > > ?? > Hal Sorry to amend my post, but what I meant of course was: (-i)**(2/3.0) ((-i)**2)**(1/3.0) (-1)**(1/3.0) -1 Hal