R/pi.r

Defines functions simpi

Documented in simpi

simpi <- function(n=1000){
  z <- 0
  res <- .C("simpi",
            PACKAGE=.package.Name,
            as.integer(n),
            as.integer(z))[[2]]
  estimate <- res/n*4
  estimate
}

Try the pscl package in your browser

Any scripts or data that you put into this service are public.

pscl documentation built on May 31, 2023, 5:17 p.m.