Using Python 3.5 both at repl.it and the console in Windows, I get wrong answers for cube roots.
When the input is (-1)**(1/3)
,
I get the complex number (0.5000000000000001+0.8660254037844386j) as the answer when it should simply be -1. Any negative value under this root seems to give a complex result.
Am I doing something wrong?
See Question&Answers more detail:os