On Dec 20, 2010, at 2:04 PM, cory n wrote:

length(sample(25000, 25000*(1-.55)))
[1] 11249

25000*(1-.55)
[1] 11250

length(sample(25000, 11250))
[1] 11250

length(sample(25000, 25000*.45))
[1] 11250

So the question is, why do I get 11249 out of the first command and not
11250?  I can't figure this one out.

Read the FAQ:
> 25000*(1-.55)-11250
[1] -1.818989e-12
> 25000*(1-.55)< 11250
[1] TRUE

?round
?all.equal
?zapsmall



--

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to