[R] R calculates small numbers, where the result should be zero

2012-09-11 Thread Andrea Gonnermann
Hi all, my problem is that R does wrong calculations, when the result should be zero. I have the following code: RD_Var1 - ((0.1*(1-0.1))/100)+((0.2*(1-0.2))/100) RD_Var2 - ((0.1*(1-0.1))/100)+((0.2*(1-0.2))/100) RD_1 - 0.1-0.2 RD_1 RD_2 - 0.1-0.2 FEM_Eff_RD -

Re: [R] R calculates small numbers, where the result should be zero

2012-09-11 Thread S Ellison
Of Andrea Gonnermann Sent: 11 September 2012 15:24 To: r-help@r-project.org Subject: [R] R calculates small numbers, where the result should be zero Hi all, my problem is that R does wrong calculations, when the result should be zero. I have the following code: RD_Var1 - ((0.1*(1-0.1

Re: [R] R calculates small numbers, where the result should be zero

2012-09-11 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Andrea Gonnermann Sent: Tuesday, September 11, 2012 4:24 PM To: r-help@r-project.org Subject: [R] R calculates small numbers, where the result should be zero Hi all

Re: [R] R calculates small numbers, where the result should be zero

2012-09-11 Thread Bryan Hanson
This is the result of how any computer program stores numbers, it's not unique to R. A slightly different question is discussed in R FAQ 7.31 but it applies to your situation. You may also enjoy the R Inferno at www.burns-stat.com/pages/Tutor/R_inferno.pdf Bryan *** Bryan Hanson

Re: [R] R calculates small numbers, where the result should be zero

2012-09-11 Thread Andrea Gonnermann
] R calculates small numbers, where the result should be zero Hi all, my problem is that R does wrong calculations, when the result should be zero. I have the following code: RD_Var1 - ((0.1*(1-0.1))/100)+((0.2*(1-0.2))/100) RD_Var2 - ((0.1*(1-0.1))/100)+((0.2*(1-0.2))/100) RD_1 - 0.1