Ryan Voots on Wed, 14 Apr 2010 06:26:57 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Bug, or what am I missing?


While I find it hard to believe that you guys could have overlooked this (I 
suspect that it has got to be something I need to do or something I'm unaware 
of)

? (-8)^(1/3)
%1 = 1.0000000000000000000000000000000000000 + 
1.7320508075688772935274463415058723669*I

I'd expect to get -2 here instead of an imaginary number.  Increasing the 
precision doesn't seem to help (just adds more digits).  Interestingly this 
number appears to be related to the correct answer.  If you take it and 
multiply by its conjugate and then take the square root you'll get close to 
the answer (just wrong sign).

? (-8)^(1/3)
%2 = 1.000000000000000000000000000 + 1.732050807568877293527446342*I
? (1.000000000000000000000000000 + 1.732050807568877293527446342*I) * 
(1.000000000000000000000000000 - 1.732050807568877293527446342*I)
%3 = 4.000000000000000000000000002 + 0.E-38*I
? (4.000000000000000000000000002 + 0.E-38*I)^(1/2)
%4 = 2.000000000000000000000000001

What am I missing here to be getting the correct answer?