[Rd] Bug in rnorm? (PR#12016)
paul.eckermann at adelaide.edu.au
paul.eckermann at adelaide.edu.au
Thu Aug 7 11:33:15 CEST 2008
Full_Name: Paul Eckermann
Version: 2.7.1
OS: Windows XP Service Pack 2
Submission from: (NULL) (129.127.183.12)
This is the first time I have submitted a bug report, so apologies if I have not
followed the correct protocol.
If I enter
length(rnorm(100*.29))
it returns 28 rather than 29.
y<-(1:100)/100
z<-sapply(y,function(x) length(rnorm(x*100)))
z!=100*y
indicates that it has something to do with multiples of 7 (rounding error?),
even though 29, 57 and 58 are the 3 values for which it returns incorrect values
of z.
I hope that this is not something obvious that I have missed. This can be
overcome by doing the x*100 calculation outside the rnorm function, but I don't
see why this needs to be done when the answer is (supposed to be) an integer.
Regards,
Paul Eckermann
More information about the R-devel
mailing list