# Question regarding (-8)^(2/3) #567

Closed
opened this Issue Feb 11, 2016 · 5 comments

Projects
None yet
3 participants

### sonnyk22 commented Feb 11, 2016

 When putting the expression of (-8)^(2/3) into my TI-84 calc, I get a result of 4. Another example is (-8)^(1/3), which should evaluate to -2. However, I am getting a different results on MathJS. Expression: (-8)^(2/3) MathJS result: -2 + 3.4641016151378i Expression: -8^(2/3) MathJS result: -4 which is correct When you get a free moment, would you help me with this.

Owner

### josdejong commented Feb 12, 2016

 Cubic roots always have three answers, and `pow` returns the principal root, which is not always the real root. Have a look into cbrt, which allows you to get all three roots: ```// (-8)^(1/3) math.cbrt(-8, true); // [1 + 1.7320508075689i, -2, 1 - 1.7320508075689i]``` See #524.

### sonnyk22 commented Feb 12, 2016

 Great readings. How would you suggest me to apply the .cbrt() function to evaluate the (-8)^(2/3) or (-8)^(-2/3) when to the power of is other than 1/3? The .eval() handles the (8)^(2/3) great, but I've noticed that when negative numbers are included such as (-8)^(2/3) or (-8)^(-2/3) then I get complex answers back.

Collaborator

### ericman314 commented Feb 12, 2016

 There's an open pull request #525 to handle this case. There's a little more work I need to do on it but the idea is you would set the config `{predictable: true}` and then `8 ^ (-2/3)` would return `-4` instead of a complex result. Let's continue the discussion in #486.

### sonnyk22 commented Feb 12, 2016

 awesome! thank you
Owner

### josdejong commented Feb 13, 2016

 Thanks @ericman314 I almost forgot about the pending #525...