The R Project SVN R

Rev

Rev 89924 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 89924 Rev 90225
Line 3685... Line 3685...
3685
          TRUE)
3685
          TRUE)
3686
## had many NA's in  3.0.0 <= R <= 3.6.x
3686
## had many NA's in  3.0.0 <= R <= 3.6.x
3687
 
3687
 
3688
 
3688
 
3689
## rhyper() for some large arguments, PR#17694
3689
## rhyper() for some large arguments, PR#17694
3690
n <- 2e9 # => .Machine$integer.max ~= 1.07 * N
3690
n <- 1e9 # => .Machine$integer.max ~= 2.14 * N
3691
set.seed(6860); N <- rhyper(1, n,n,n)
3691
set.seed(6860); N <- rhyper(1, n,n,n)
3692
x <- 1.99e9; Nhi <- rhyper(256, x,x,x)
3692
x <- .99e9; Nhi <- rhyper(256, x,x,x)
3693
stopifnot(#identical(N, 999994112L), # (wrong) implementation detail
3693
stopifnot(#identical(N, 999994112L), # (wrong) implementation detail
3694
          is.integer(Nhi),
3694
          is.integer(Nhi),
3695
          all.equal(mean(Nhi), x/2, tol = 6e-6)) # ==> also: no NAs
3695
          all.equal(mean(Nhi), x/2, tol = 6e-6)) # ==> also: no NAs
3696
## NA's and warnings, incl "SHOULD NOT HAPPEN!" in R <= 3.6.2
3696
## NA's and warnings, incl "SHOULD NOT HAPPEN!" in R <= 3.6.2
3697
 
3697