-
Notifications
You must be signed in to change notification settings - Fork 205
Closed
Milestone
Description
Hello!
mpmath.power() fails with negative numbers. Initially I expect to have something like -8**(1./3)=-2. In reality there are 3 roots for 1./3 power and ok, let it be some other answer. But why I didn't get exact 1.0 as a real part and exact sqrt(3) as imaginary part?
$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
import mpmath
mpmath.mp.dps=50
mpmath.power(-8.0,1./3)
mpc(real='1.0000000000000000622086928455818618679774324989807018', imag='1.7320508075688771687514964885913910681346917057935831')
mpmath.sqrt(3)
mpf('1.732050807568877293527446341505872366942805253810381')
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels