Why is (-27)**(1.0/3.0) not -3.0 in Python?

前端 未结 3 2034
耶瑟儿~
耶瑟儿~ 2020-12-21 01:46

In math, you are allowed to take cubic roots of negative numbers, because a negative number multiplied by two other negative numbers results in a negative number. Raising so

3条回答
  •  抹茶落季
    2020-12-21 02:44

    I do not think Python, or your version of it, supports this function. I pasted the same equation into my Python interpreter, (IDLE) and it solved it, with no errors. I am using Python 3.2.

提交回复
热议问题