Same for me on Mac OS X:
> x <- c(0.1819711,0.4811463,0.1935151,0.1433675)
> 1-sum(x)
[1] 0
> version$version.string
[1] "R version 2.11.1 Patched (2010-05-31 r52180)"
Regards,
Jorge
On Tue, Jun 15, 2010 at 6:40 PM, Gabor Grothendieck <> wrote:
> On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee <> wr
-help@r-project.org
Subject: Re: [R] Problem about zero
On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee wrote:
> Hello, everyone,
>
> There's a problem about zero in R and I really need your help.
>
>
>
> I have a vector shown as x=c(0.1819711,0.4811463,0.1935151,0.1433675)
On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee wrote:
> Hello, everyone,
>
> There's a problem about zero in R and I really need your help.
>
>
>
> I have a vector shown as x=c(0.1819711,0.4811463,0.1935151,0.1433675),
>
> The sum of this vector is shown as 1 in R, but when I type 1-sum(x), the
> value
Hello Yen,
You may find ?zapsmall helpful. If your algorithm expects 1-sum(x) to
have a lower bound of zero, then also simply setting a cutoff point
seems reasonable.
Josh
On Tue, Jun 15, 2010 at 3:00 PM, Yen Lee wrote:
> Hello, everyone,
>
> There's a problem about zero in R and I really need
Hi Yen,
See
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
HTH,
Jorge
On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee <> wrote:
> Hello, everyone,
>
> There's a problem about zero in R and I really need your help.
>
>
>
> I have a vector shown as x=c
Hello, everyone,
There's a problem about zero in R and I really need your help.
I have a vector shown as x=c(0.1819711,0.4811463,0.1935151,0.1433675),
The sum of this vector is shown as 1 in R, but when I type 1-sum(x), the
value is not zero, but -2.220446e-16.
I can accept that this value i
6 matches
Mail list logo