[R] (-8)^(1/3) == NaN?

Liviu Andronic landronimirc at gmail.com
Sun Jul 19 22:40:42 CEST 2009


On Sun, Jul 19, 2009 at 7:33 PM, jim holtman<jholtman at gmail.com> wrote:
> -8^1/3 is parsed as -(8^1)/3 = -2.66666
>

However the following is evaluated as one would expect:
> 8^(1/3)
[1] 2
> -8^(1/3)
[1] -2

Perhaps it is parsed in this way:
> -(8^(1/3))
[1] -2

Liviu




More information about the R-help mailing list