If the power that a number is being raised to is integer, then is does evaluate honoring the unary minus.
> (-2) ^ 5 #integer power [1] -32 > (-2) ^ 5.1 [1] NaN > -8^(1/3) is parsed as -(8^(1/3)) according to operator precedence. On Sun, Jul 19, 2009 at 4:49 PM, Liviu Andronic<landronim...@gmail.com> wrote: > On Sun, Jul 19, 2009 at 12:28 AM, jim holtman<jholt...@gmail.com> wrote: >> First of all, read FAQ 7.31 to understand that 1/3 is not >> representable in floating point. Also a^b is actually exp(log(a) * b) >> and log(-8) is not valid (NaN). >> > > If this is so, why would the following evaluate as expected? >> (-8)^(3) > [1] -512 > > Liviu > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.