Re: [R] calculate differences - strange outcome

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Thu, 17 Jul 2008 06:24:39 -0400

Kunzler, Andreas wrote:
> Dear List,
>
> I ran into some trouble by calculating differences. For me it is
> important that differences are either 0 or not.
>
> So I don't understand the outcome of this calculation
>
> 865.56-(782.86+0+63.85+18.85+0)
> [1] -1.136868e-13
>
> I run R version 2.71 on WinXP
>
> I could solve my problem by using
> round()
> but I would like to know the reason.
> Maybe someone can help me?

This is FAQ 7.31.

Duncan Murdoch



R-help_at_r-project.org 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. Received on Thu 17 Jul 2008 - 10:44:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jul 2008 - 11:32:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive