[R] -1.1 - 0.1 + 1.2 is NOT null! Why?

massimodisasha massimodisasha at gmail.com
Wed Jul 11 00:23:47 CEST 2012


Il 7/10/12 4:17 PM, ollestrat ha scritto:
> Hello,
>
> I fear its a stupid question,..but here it is:
>
> If I do this simple calculation with the R  console, I surprisingly do not
> get a zero. Why?
>
>   -1.1-0.1+1.2
> [1] -2.220446e-16
>
>
> greetings, Ole
>
> --
> View this message in context: http://r.789695.n4.nabble.com/1-1-0-1-1-2-is-NOT-null-Why-tp4636053.html
> Sent from the R help mailing list archive at Nabble.com.
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
...

Python :
 >>> -1.1-0.1+1.2
-2.220446049250313e-16
 >>> -1.2-0.2+1.4
0.0
 >>>

R :
 > -1.1-0.1+1.2
[1] -2.220446e-16
 > -1.2-0.2+1.4
[1] 0
 >



More information about the R-help mailing list