Displaying 1 result from an estimated 1 matches for "echoback".
2011 Oct 18
2
Remote environments, calling functions
...min = -r, max = r)
y <- runif(numDraws, min = -r, max = r)
inCircle <- ifelse((x^2 + y^2)^0.5 < r, 1, 0)
sum(inCircle)/length(inCircle) * 4
}
At some point later (in C) I package all this up and send it somewhere else,
where deserialize it (with care):
> ls(env)
[1] "echoBack" "estimatePi" "r"
> env$estimatePi
function (seed)
{
set.seed(seed)
numDraws <- 1e+05
x <- runif(numDraws, min = -r, max = r)
y <- runif(numDraws, min = -r, max = r)
inCircle <- ifelse((x^2 + y^2)^0.5 < r, 1, 0)
sum(inCircle)/leng...