>> can you explain that a little more detailed?
>> Perhaps I miss the background knowledge - but it seems just absurd
to me.
>>
>> 0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
>>
>> why is
>> x <- 0.1 + 0.1 +0.1
>> not equal to
>> y <- 0.3
>
> Remember that this is in BINARY a
> -Original Message-
> From: Peter Dalgaard [mailto:p.dalga...@biostat.ku.dk]
> Sent: Wednesday, September 30, 2009 3:58 PM
> To: Nordlund, Dan (DSHS/RDA)
> Cc: Douglas Bates; r help
> Subject: Re: [R] Rounding error in seq(...)
>
<<>>
> >
> &g
Nordlund, Dan (DSHS/RDA) wrote:
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Douglas Bates
Sent: Wednesday, September 30, 2009 3:06 PM
To: Peter Dalgaard
Cc: r help; Duncan Murdoch
Subject: Re: [R] Rounding error in seq(...)
On
> In an earlier thread on this theme I believe that someone quoted Brian
> Kernighan as saying "10 times 0.1 is hardly ever 1" but I haven't been
> able to track down the quote. Can anyone point us to such a quote?
> It summarizes the situation succinctly,
See FAQ 7.31 :)
___
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Douglas Bates
> Sent: Wednesday, September 30, 2009 3:06 PM
> To: Peter Dalgaard
> Cc: r help; Duncan Murdoch
> Subject: Re: [R] Rounding error in seq(...
On Sep 30, 2009, at 6:05 PM, Douglas Bates wrote:
On Wed, Sep 30, 2009 at 2:32 PM, Peter Dalgaard> wrote:
Martin Batholdy wrote:
hum,
can you explain that a little more detailed?
Perhaps I miss the background knowledge - but it seems just absurd
to me.
0.1+0.1+0.1 is 0.3 - there is no ro
On Wed, Sep 30, 2009 at 2:32 PM, Peter Dalgaard wrote:
> Martin Batholdy wrote:
>>
>> hum,
>>
>> can you explain that a little more detailed?
>> Perhaps I miss the background knowledge - but it seems just absurd to me.
>>
>> 0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
>>
>> why is
On 30-Sep-09 19:32:46, Peter Dalgaard wrote:
> Martin Batholdy wrote:
>> hum,
>>
>> can you explain that a little more detailed?
>> Perhaps I miss the background knowledge - but it seems just absurd to
>> me.
>>
>> 0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
>>
>> why is
>> x <
On 9/30/2009 3:59 PM, Ista Zahn wrote:
For my own edification more than anything (I never took computer science): is
a = seq(0.1,0.9,by=0.1)
a <- as.character(a)
a[3] == "0.3"
[1] TRUE
safe?
No. Someone might be in a locale where the comma is used as the decimal
separator. Take a look at
For my own edification more than anything (I never took computer science): is
> a = seq(0.1,0.9,by=0.1)
> a <- as.character(a)
> a[3] == "0.3"
[1] TRUE
safe?
-Ista
On Wed, Sep 30, 2009 at 3:46 PM, cls59 wrote:
>
>
> Martin Batholdy wrote:
>>
>> hum,
>>
>> can you explain that a little more det
Martin Batholdy wrote:
>
> hum,
>
> can you explain that a little more detailed?
> Perhaps I miss the background knowledge - but it seems just absurd to
> me.
>
> 0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
>
>
Unfortunately this comes as an utter shock to many people wh
See:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
On Wed, Sep 30, 2009 at 2:40 PM, Michael Knudsen wrote:
> Hi,
>
> Today I was flabbergasted to see something that looks like a rounding
> error in the very basic seq function in R.
>
>> a = seq
r-help-boun...@r-
> project.org] On Behalf Of Martin Batholdy
> Sent: Wednesday, September 30, 2009 1:18 PM
> To: Duncan Murdoch
> Cc: r help
> Subject: Re: [R] Rounding error in seq(...)
>
> hum,
>
> can you explain that a little more detailed?
> Perhaps I miss the back
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Martin Batholdy
> Sent: Wednesday, September 30, 2009 12:18 PM
> To: Duncan Murdoch
> Cc: r help
> Subject: Re: [R] Rounding error in seq(...)
>
>
Martin Batholdy wrote:
hum,
can you explain that a little more detailed?
Perhaps I miss the background knowledge - but it seems just absurd to me.
0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
why is
x <- 0.1 + 0.1 +0.1
not equal to
y <- 0.3
Remember that this is in BINARY ar
On 1/10/2009, at 8:17 AM, Martin Batholdy wrote:
hum,
can you explain that a little more detailed?
Perhaps I miss the background knowledge - but it seems just absurd to
me.
0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
why is
x <- 0.1 + 0.1 +0.1
not equal to
y <- 0.3
?
You
On 9/30/2009 3:17 PM, Martin Batholdy wrote:
hum,
can you explain that a little more detailed?
Perhaps I miss the background knowledge - but it seems just absurd to
me.
0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
R uses a binary floating point storage format, which is the
On Wed, Sep 30, 2009 at 8:40 PM, Michael Knudsen wrote:
>> a = seq(0.1,0.9,by=0.1)
>> a
> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
>> a[1] == 0.1
> [1] TRUE
>> a[2] == 0.2
> [1] TRUE
>> a[3] == 0.3
> [1] FALSE
A friend of mine just pointed out a possible solution:
> a=seq(0.1,0.9,by=0.1)
> a = s
hum,
can you explain that a little more detailed?
Perhaps I miss the background knowledge - but it seems just absurd to
me.
0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
why is
x <- 0.1 + 0.1 +0.1
not equal to
y <- 0.3
?
Am 30.09.2009 um 21:04 schrieb Duncan Murdoch:
On
On 9/30/2009 2:50 PM, Michael Knudsen wrote:
On Wed, Sep 30, 2009 at 8:44 PM, Duncan Murdoch wrote:
Why? You asked for an increment of 1 in the second case (which is exactly
represented in R), then divided by 10, so you'll get the same as 0.3 gives
you. In the seq() case you asked for an inc
To: Duncan Murdoch
Cc: r help
Subject: Re: [R] Rounding error in seq(...)
On Wed, Sep 30, 2009 at 8:44 PM, Duncan Murdoch
wrote:
> Why? You asked for an increment of 1 in the second case (which is exactly
> represented in R), then divided by 10, so you'll get the same as 0.3 gives
>
On Wed, Sep 30, 2009 at 8:44 PM, Duncan Murdoch wrote:
> Why? You asked for an increment of 1 in the second case (which is exactly
> represented in R), then divided by 10, so you'll get the same as 0.3 gives
> you. In the seq() case you asked for an increment of a number close to but
> not equa
On 9/30/2009 2:40 PM, Michael Knudsen wrote:
Hi,
Today I was flabbergasted to see something that looks like a rounding
error in the very basic seq function in R.
a = seq(0.1,0.9,by=0.1)
a
[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
a[1] == 0.1
[1] TRUE
a[2] == 0.2
[1] TRUE
a[3] == 0.3
[1] F
Hi,
Today I was flabbergasted to see something that looks like a rounding
error in the very basic seq function in R.
> a = seq(0.1,0.9,by=0.1)
> a
[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
> a[1] == 0.1
[1] TRUE
> a[2] == 0.2
[1] TRUE
> a[3] == 0.3
[1] FALSE
It turns out that the alternative
> a
24 matches
Mail list logo