Displaying 5 results from an estimated 5 matches for "wrong_003f".
2009 Jul 18
7
(-8)^(1/3) == NaN?
Why does the expression "(-8)^(1/3)" return NaN, instead of -2?
This is not answered by http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-powers-of-negative-numbers-wrong_003f
Thanks,
Dave
[[alternative HTML version deleted]]
2009 Dec 12
1
cube root on array
Dear R developers,
is that right?
> -27^(1/3)
[1] -3
> c(-27,27)^(1/3)
[1] NaN 3
i'm using sign( c(-27,27) ) * abs( c(-27,27)) ^(1/3) ,
thanks
[[alternative HTML version deleted]]
2011 May 12
1
about vector to the power of a decimal
Hi
why I can't do this?
m<-c(1,-2,3)
m^2.1
with a negative number in it ,but I can do this to a single negative number like -2^2.1~
Thank you ~
JIngsi
[[alternative HTML version deleted]]
2009 Jan 03
5
Power functions?
I had a question about the basic power functions in R.
For example from the R console I enter:
-1 ^ 2
[1] -1
but also
-1^3
[1] -1
-0.1^2
[1] -0.01
Normally pow(-1, 2) return either -Infinity or NaN. Has R taken over the math functions? If so I would think that -1^2 is 1 not -1 and -0.1^2 is 0.01 not -0.01.
Thank you.
Kevin
2008 Jul 01
5
WIERD: Basic computing in R
Can someone please enlighten me as to why the following happens?
> -2.7^8.6
[1] -5125.407
> p<- -2.7
> q<- 8.6
> p^q
[1] NaN
R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are assigned to variables and then the computation is repeated.
Thanks in advance for any suggetsions.
Kris.