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

2012-07-13 Thread ollestrat
Someone pointed me to this paper: http://www.validlab.com/goldberg/paper.pdf -- View this message in context: http://r.789695.n4.nabble.com/1-1-0-1-1-2-is-NOT-null-Why-tp4636053p4636433.html Sent from the R help mailing list archive at Nabble.com. __

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

2012-07-13 Thread ollestrat
Thank you for the explanation. Good to know about the issue how double values are "constructed" by a bit system. This makes me handling double values with care in using it in R or aother languages control structures etc. Thank you also for the hint concerning the Null vs. Zero vs.. issue. Yes, th

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

2012-07-12 Thread Erdal Karaca
I was just trying to say that Ole might know the technical difference between "NULL" and "ZERO", but it seemed to be rather a linguistic confusion... BTW. the subject contains "null", but the body of the mail correctly states "zero" :-) 2012/7/12 Patrick Connolly > On Tue, 10-Jul-2012 at 11:19P

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

2012-07-12 Thread Patrick Connolly
On Tue, 10-Jul-2012 at 11:19PM +0200, Erdal Karaca wrote: |> german "Null" == english "zero" :-) German "Gift" == English "poison" :-( |> |> 2012/7/10 Rolf Turner |> |> > |> > |> > In addition to taking cognisance of Richard Heiberger's reply you |> > should also learn to distinguish b

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

2012-07-11 Thread Richard M. Heiberger
This is a fascinating example. It is an accident that it looks like it comes out even. Here are both sets displayed using hex format where we see exactly what bits are used in the internal representation of the numbers. > dphex <- function(x) {sprintf("%+.13a", x)} > ones <- c(-1.1, +

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

2012-07-10 Thread arun
Hi, Perl: perl -e 'print -1.1-0.1+1.2. "\n";' -2.22044604925031e-16 perl -e 'print -1.2-0.2+1.4. "\n";' 0 A.K. - Original Message - From: massimodisasha To: ollestrat ; r-help@r-project.org Cc: Sent: Tuesday, July 10, 2012 6:23 PM Subject: R

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

2012-07-10 Thread Erdal Karaca
german "Null" == english "zero" :-) 2012/7/10 Rolf Turner > > > In addition to taking cognisance of Richard Heiberger's reply you > should also learn to distinguish between the concept of "null" and > "zero". They are not at all the same thing. > > cheers, > > Rolf Turner > > > On 1

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

2012-07-10 Thread massimodisasha
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.na

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

2012-07-10 Thread Rolf Turner
But R-ish NULL is *NOT* equal to R-ish zero, and that's what counts here. cheers, Rolf Turner On 11/07/12 09:19, Erdal Karaca wrote: > german "Null" == english "zero" :-) > > 2012/7/10 Rolf Turner > > > > > In addition to taking cognisance of Ri

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

2012-07-10 Thread Rolf Turner
In addition to taking cognisance of Richard Heiberger's reply you should also learn to distinguish between the concept of "null" and "zero". They are not at all the same thing. cheers, Rolf Turner On 11/07/12 08:17, ollestrat wrote: Hello, I fear its a stupid question,..but her

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

2012-07-10 Thread William Dunlap
at > Sent: Tuesday, July 10, 2012 1:17 PM > To: r-help@r-project.org > Subject: [R] -1.1 - 0.1 + 1.2 is NOT null! Why? > > 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 > g

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

2012-07-10 Thread Richard M. Heiberger
This is the behavior of the floating point number representation. Decimal fractions do not come out even in binary notation. Please see FAQ 7.31 On Tue, Jul 10, 2012 at 4:17 PM, ollestrat wrote: > Hello, > > I fear its a stupid question,..but here it is: > > If I do this simple calculation with

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

2012-07-10 Thread ollestrat
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-tp4636