[R] WIERD: Basic computing in R
Dirk Eddelbuettel
edd at debian.org
Tue Jul 1 20:19:17 CEST 2008
On Tue, Jul 01, 2008 at 11:15:58AM -0700, poolloopus at yahoo.com wrote:
> 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.
Try
-(p^q)
Dirk
--
Three out of two people have difficulties with fractions.
More information about the R-help
mailing list