Skip to content
Prev 67995 / 398506 Next

Difference

On Tue, 2005-04-19 at 10:19 +0200, Ralf Strobl wrote:
Yes. Floating point arithmetic isn't as accurate as you think. Your
numbers have a simple representation in decimal format, but are stored
in the computer in binary, so there is some rounding error.
[1] -2.775558e-17

You probably want to use "all.equal" to test for "near" equality
[1] TRUE
[1] TRUE

See the help pages for all.equal and identical for more details.

Martyn