Skip to content
Prev 165927 / 398502 Next

Power functions?

on 01/03/2009 02:32 PM rkevinburton at charter.net wrote:
Kevin,

See R FAQ 7.33 Why are powers of negative numbers wrong?

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-powers-of-negative-numbers-wrong_003f


For the issue of returning -Inf or NaN, I suspect that you are thinking
about negative numbers being raised to non-integer powers. For example,
taking into consideration the enlightenment in the above FAQ:
[1] NaN
[1] NaN
[1] NaN
Warning message:
In sqrt(-2) : NaNs produced
[1] NaN


HTH,

Marc Schwartz