mpfrVersion()
(x <- c(Const("pi", 64), mpfr(-2:2, 64)))
mpfr.is.0(x) # one of them is
x[mpfr.is.0(x)] # but it may not have been obvious..
str(x)
xy <- expand.grid(x = -2:2, y = -2:2) ; x <- xy[,"x"] ; y <- xy[,"y"]
a2. <- atan2(y,x)
stopifnot(all.equal(a2., atan2(as(y,"mpfr"), x)),
mpfr.is.integer(mpfr(2, 500) ^ (1:200)),
all.equal(diff(x), diff(as.numeric(x))),
TRUE)
Run the code above in your browser using DataLab