[R] Behaviour of very large numbers
Scionforbai
scionforbai at gmail.com
Thu Aug 30 17:24:44 CEST 2007
Hello,
it seems to be an R bug. It gives strange errors for non-integer exponents:
> version
platform i686-redhat-linux-gnu
version.string R version 2.4.1 (2006-12-18)
> x^47.0
[1] -1.802180e+80 -1.768932e+80 -1.736284e+80 -1.704227e+80
-1.672748e+80 [...]
> x^47.10
[1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN [...]
> x[2]^b
[1] NaN
But:
> x[2]
[1] -50.9798
> -50.9798^b
[1] -3.131003e+81
So it is not a merely numerical problem. Maybe a bug in memory
allocation for vectors containing such big numbers?
Scion
More information about the R-help
mailing list