Status: Accepted
Owner: smichr
Labels: Type-Defect Priority-High

New issue 1538 by smichr: root of negative number
http://code.google.com/p/sympy/issues/detail?id=1538

Can someone find out where this is originiting? Sympy can correctly compute
1/imag_number and can compute the nth rooth of a negative number but is
having problems with 1/nth_root_of_negative:

>>> a=(-65)**(S(1)/6)
>>> a.evalf()
1.73205080756888 + I #so there's an imaginary number

if you take that evaluated value and invert it, all is ok
>>> print (1/a.evalf()).evalf()
0.431895228023866 - 0.249354826161294*I #this is the correct value

but if you evaluate after taking the ratio, it's wrong
>>> (1/a).evalf()
  0.431895228023866 + 0.249354826161294*I #this is wrong

If there is an exact nth root exptractable then the right answer is
obtained. Note in the following that both results are the same:
>>> a=(-64)**(S(1)/6);print (1/a.evalf()).evalf(),(1/a).evalf()
0.433012701892219 - 0.25*I 0.433012701892219 - 0.25*I

/c

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to