[Rd] bug with var(rep(1e30, 3)) (PR#1228)

paradis@isem.univ-montp2.fr paradis@isem.univ-montp2.fr
Wed, 26 Dec 2001 13:07:57 +0100 (MET)


There seems to be a bug with var() when the argument is a vector with
exactly three values of 1e30 (or close to this value). This does not happen
with twice, four (or more) times this value, or another value.


> var(rep(1e30, 3))
[1] 2.971056e+28
> var(rep(1.2e30, 3))
[1] 2.971056e+28
> var(rep(0.9e30, 3))
[1] 2.971056e+28
> var(rep(0.8e30, 3))
[1] 0
> var(rep(1e29, 3))
[1] 0
> var(rep(1e30, 2))
[1] 0
> var(rep(1e30, 4))
[1] 0
> var(rep(1e31, 3))
[1] 0


The bug is repeatable, and I got the same results with R 1.3.1 (binary from
CRAN) and R 1.4.0 (binary from BD Ripley's site) both on Windows NT, and R
1.4.0 on Solaris (compiled from sources).



Emmanuel Paradis
Laboratoire de Paléontologie
Institut des Sciences de l'Évolution
Université Montpellier II
F-34095 Montpellier cédex 05
France
   phone: +33  4 67 14 39 64
     fax: +33  4 67 14 36 10
  mailto:paradis@isem.univ-montp2.fr

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._