I encountered an error that makes no sense to me.
When using min(diff(x))
on integer numbers, no error occurs. But when using doubles, there is something wrong.
x <- c(1, 3, 5, 6, 8, 10)
min(diff(x))
# 1
min(diff(x)) == 1
# TRUE
But when doing this on doubles, the following happens...
x <- c(0.1, 0.3, 0.5, 0.6, 0.8, 1.0)
min(diff(x))
# 0.1
min(diff(x)) == 0.1
# FALSE
Also, the result of min(diff(x))
has the identical format as a regular double variable.
Can you reproduce this? I am using R 3.0.1
Is this error worth reporting?