Closed cyn4289 closed 8 months ago
(-1)^(1/3), and other fractional exponents, returns the principal root, while cbrt() and root() returns the real-valued root, for negative bases.
This is common behaviour among mathematical software.
(-1)^(1/3), and other fractional exponents, returns the principal root, while cbrt() and root() returns the real-valued root, for negative bases.
This is common behaviour among mathematical software.
You're totally right, I tested it with a few different programs and it's pretty inconsistent and often this behavior is there, should've done more than check against chrome's calculator before opening the issue
expected behavior: (-1)^(1/3) = cbrt(-1) = -1
issue: cbrt(-1) evaluates correctly to -1, however (-1)^(1/3) unexpectedly evaluates to a different value including an imaginary part. I suspect that whatever handles simplifying expressions including imaginary numbers is messing this up.
version info: Qalc version 4.9.0 (CLI) Windows 11 10.0.22621
edit: -1 and 0.5+0.8660254038i are both correct answers, and other programs sometimes do this as well-- it'd still be nice to show both or at least show the same one.