After upgrading to R-2.3.1 on Linux Redhat, I was suprised by this:
R x - c(721.077, 592.291, 372.208, 381.182)
R sum(x) - 2066.758
[1] 4.547474e-13
Now I understand that floating point arithmetic is not precise, but
1) the result is exactly 0 in R-2.2.1 (patched) on the same machine,
2)
I think you want to look at
sum(x)/2066.758 - 1
which on my Linux box is 2.2e-16.
-roger
Brahm, David wrote:
After upgrading to R-2.3.1 on Linux Redhat, I was suprised by this:
R x - c(721.077, 592.291, 372.208, 381.182)
R sum(x) - 2066.758
[1] 4.547474e-13
Now I understand that
I was concerned by this result (new in R-2.3.1):
R x - c(721.077, 592.291, 372.208, 381.182)
R sum(x) - 2066.758
[1] 4.547474e-13
But after Roger Peng's [EMAIL PROTECTED] insightful comment that the
relative difference (sum(x)/2066.758 - 1) is exactly what is expected,
I'm convinced that sum()
But after Roger Peng's [EMAIL PROTECTED] **insightful** comment that the
... but as we are not in that other S language dialect, maybe it should
be his **peRceptive** comment. ;-)
(Sorry -- it's Friday)
-- Bert Gunter
__
R-help@stat.math.ethz.ch