[Rd] Bug in rnorm? (PR#12016)

From: <paul.eckermann_at_adelaide.edu.au>
Date: Thu, 07 Aug 2008 11:33:15 +0200 (CEST)


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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 07 Aug 2008 - 09:38:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 07 Aug 2008 - 10:36:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive