[R] ^-operation exponentiation problem

Alexander Singer alsi at oesa.ufz.de
Wed Aug 13 20:09:06 CEST 2003


Hi,
There seems to be a problem with the power-operation of the form c(...,
-a, ...)^x.yyy
Four code examples for the same calculation, which perform differently:

-3^3.2
Result: [1] -33.63474

c(-3,6)^3.2
Result: [1]      NaN 309.0893
But:
c(-3.62,3)^3
Result: [1] -47.43793  27.00000

I can reproduce NaN even in the following calculation:
c(-3,6)[1]^3.2 
Result: [1] NaN
but
c(-3,6)[2]^3.2
Result: [1] 309.0893

Does anybody know this problem and a solution to it?
We have tested the calculation under Windows XP for R version 1.6.0 and
1.7.1
Greetings Alex




More information about the R-help mailing list