(-1)^(1/3) is NaN, where it should be -1

Issue #175 invalid
Former user created an issue

Originally reported on Google Code with ID 175 ``` What steps will reproduce the problem? 1.enter (-1)^(1/3) in speedcrunch 0.10

What is the expected output? What do you see instead? the expected result is -1. the reult is NaN

What version of the product are you using? On what operating system? 0.10/win

Please provide any additional information below.

```

Reported by `sdavma` on 2008-04-01 16:18:23

Comments (3)

  1. Former user Account Deleted

    ``` We have discussed this already several times, see issue #55 for example. I just copy a portion from the SpeedCrunch manual as an explanation:

    "However, in general, raising a negative number to an arbitrary non-integer exponent is not possible for SpeedCrunch, because

    (1) there exist always at least two, usually infinite many results; (2) these results are, in rare cases with only one exception, true complex values,

    especially the principal value is always complex.

    The rare cases are when the exponent is rational, and its denominator is odd. For example, the 3rd root (or (1/3)-rd power) of (-1) has three solutions in the complex plane, namely (sqrt(3)/2 + 1/2*i), (-1) and (sqrt(3)/2 – 1/2*i). Of these, the first is denoted by mathematicians as the principal value (and not (-1), that is so nicely real-valued). Without delving too deep into the theory here, one can see, that it is impossible to spot the few exceptions, where a single negative real-valued result (among many others) exists, especially, if the exponent is only given approximately (1/3 is evaluated internally to 0.3333...) and so cannot safely be identified as of rational origin." ```

    Reported by `wolf.lammen` on 2008-04-01 19:12:29 - Status changed: `Invalid`

  2. Former user Account Deleted

    ``` Thx, Wolf. And again, like I said in other issue just like this one, sdavma: if the goal is to calculate the cube root, there is the cbrt() function. ```

    Reported by `helder.pereira.correia` on 2008-04-01 20:25:07

  3. Former user Account Deleted

    ``` Hi guys, may you please add this to FAQ (also mentioning cbrt)? ```

    Reported by `alek.silverstone` on 2010-01-27 06:38:42

  4. Log in to comment