Hi Duncan
[snip] On 11 Sep 2006, at 12:12, Duncan Murdoch wrote: > Here's my version: not tested too much. > > f <- function(x) { > u <- x > l <- 0 > mid <- u/2 > while (l < mid && mid < u) { > if (x < x + mid) u <- mid > else l <- mid > mid <- (l + u)/2 > } > u > } > thanks for this. Wouldn't it be a good idea to have some function that returns "the smallest exactly representable number strictly greater than x"? Or does this exist already? Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 ______________________________________________ R-help@stat.math.ethz.ch 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.