{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/8814","labels_url":"https://api.github.com/repos/sympy/sympy/issues/8814/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/8814/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/8814/events","html_url":"https://github.com/sympy/sympy/pull/8814","id":54096232,"number":8814,"title":"[RFC] real_roots mods","user":{"login":"smichr","id":90703,"avatar_url":"https://avatars.githubusercontent.com/u/90703?v=3","gravatar_id":"","url":"https://api.github.com/users/smichr","html_url":"https://github.com/smichr","followers_url":"https://api.github.com/users/smichr/followers","following_url":"https://api.github.com/users/smichr/following{/other_user}","gists_url":"https://api.github.com/users/smichr/gists{/gist_id}","starred_url":"https://api.github.com/users/smichr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smichr/subscriptions","organizations_url":"https://api.github.com/users/smichr/orgs","repos_url":"https://api.github.com/users/smichr/repos","events_url":"https://api.github.com/users/smichr/events{/privacy}","received_events_url":"https://api.github.com/users/smichr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-12T19:33:25Z","updated_at":"2015-01-14T21:52:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/8814","html_url":"https://github.com/sympy/sympy/pull/8814","diff_url":"https://github.com/sympy/sympy/pull/8814.diff","patch_url":"https://github.com/sympy/sympy/pull/8814.patch"},"body":"Something has to be done to allow one to compute real_root(float, odd) as real. At first I thought to handle this in real_root, but then I thought it might be better to catch it in _eval_power itself. Which do you think is better:\r\n\r\n```python\r\n# This is how a negative rational base behaves:\r\n\r\n>>> root(S('-1/10'),3)\r\n(-1)**(1/3)*10**(2/3)/10\r\n\r\n# Now, for a negative float...\r\n\r\n>>> root(S('-.1'),3)\r\n0.464158883361278*(-1)**(1/3)  # <-- should a negative float give this (a)\r\n>>> _.n()\r\n0.232079441680639 + 0.401973384383085*I  # <-- or this (b)?\r\n```\r\n\r\nThe trend is to fully evaluate an expression if args are numbers, but by selecting the principle root in the case of Pow, the user looses the option to select the real branch post-calc."},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/69999463","html_url":"https://github.com/sympy/sympy/pull/8814#issuecomment-69999463","issue_url":"https://api.github.com/repos/sympy/sympy/issues/8814","id":69999463,"user":{"login":"smichr","id":90703,"avatar_url":"https://avatars.githubusercontent.com/u/90703?v=3","gravatar_id":"","url":"https://api.github.com/users/smichr","html_url":"https://github.com/smichr","followers_url":"https://api.github.com/users/smichr/followers","following_url":"https://api.github.com/users/smichr/following{/other_user}","gists_url":"https://api.github.com/users/smichr/gists{/gist_id}","starred_url":"https://api.github.com/users/smichr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smichr/subscriptions","organizations_url":"https://api.github.com/users/smichr/orgs","repos_url":"https://api.github.com/users/smichr/repos","events_url":"https://api.github.com/users/smichr/events{/privacy}","received_events_url":"https://api.github.com/users/smichr/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T21:52:36Z","updated_at":"2015-01-14T21:52:36Z","body":"Currently, there is no function for computing only real roots (real_roots is just a convenience function that returns a special form of Pow under certain conditions). Therefore, there is no way to substitute a float into an expression *and then* calculate the real roots of odd-powered radicals. So I'll commit this as is."}}