Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pow function
#1
hi,
I met a problem when using the built-in function pow().
here is the code:
In [1]: pow(-2, 1/3)
Out [1]: (0.6299605249474367+1.0911236359717214j)
In [2]: (-2) ** 1/3
Out [2]: -0.6666666666666666
The document says pow(x, y) is equivalent to x ** y, but it is different here.
Why??
I use python3.6, anaconda Spyder.
Reply


Messages In This Thread
pow function - by luoheng - Sep-12-2018, 02:27 AM
RE: pow function - by Gribouillis - Sep-12-2018, 03:27 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020