On Thu, 2008-12-11 at 17:23 +0200, Kenn Konstabel wrote:
> Hi,
>
> I agree -- and my examples using round were meant as bad and dangerous
> examples. Using round at the last step is better and may solve the problem,
> but in your example ...
>
> > round(8.8-7.8,1)==1
> [1] TRUE
>
> ... you have
ational Institute of Cardiology
> Brazil
>
> -- Original Message ---
> From: "Kenn Konstabel" <[EMAIL PROTECTED]>
> To: "emma jane" <[EMAIL PROTECTED]>
> Cc: R help <[EMAIL PROTECTED]>
> Sent: Thu, 11 Dec 2008 11:53:01 +0200
>
CTED]>
To: "emma jane" <[EMAIL PROTECTED]>
Cc: R help <[EMAIL PROTECTED]>
Sent: Thu, 11 Dec 2008 11:53:01 +0200
Subject: Re: [R] Logical inconsistency
> Rounding can do no good because
>
> round(8.8,1)-round(7.8,1)>1
> # still TRUE
> round(8.8)-ro
;[EMAIL PROTECTED]>
>
> .com.br>; Wacek Kusnierczyk <[EMAIL PROTECTED]>; Chuck
> Cleland <[EMAIL PROTECTED]>
> Cc: R help <[EMAIL PROTECTED]>
> Sent: Tuesday, 9 December, 2008 16:30:08
> Subject: RE: [R] Logical inconsistency
>
> Some (possibly all) of
On Tue, 2008-12-09 at 06:02 -0800, emma jane wrote:
> Many thanks for your help, perhaps I should have set my query in context
> !
>
> I'm simply calculating an indicator variable [0,1] based on the whether the
> difference between two measured variables is > 1 or <=1.
>
> I understand the
problem by
>> rounding the variables before taking the difference between them.
>>
>> Thanks to all who replied.
>>
>> Emma JaneÂ
>>
>>
>>
>>
>> From: Greg Snow <[EMAIL PROTECTED]>
>>
>> .com.br>; Wacek Kusnier
OTECTED]>
Sent: Tuesday, 9 December, 2008 16:30:08
Subject: RE: [R] Logical inconsistency
Some (possibly all) of those numbers cannot be represented exactly, so there is
a chance of round off error whenever you do some arithmetic, sometimes the
errors cancel out, sometimes they don't. C
;[EMAIL PROTECTED]>; Chuck Cleland <[EMAIL
PROTECTED]>
Cc: R help <[EMAIL PROTECTED]>
Sent: Tuesday, 9 December, 2008 16:30:08
Subject: RE: [R] Logical inconsistency
Some (possibly all) of those numbers cannot be represented exactly, so there is
a chance of round off error whenever y
And here one is very much inclined to chirp in and say, "A matchless Wacek
strikes again."
Regards, and thanks to all for a most entertaining (and enlightening)
thread.
Wacek Kusnierczyk wrote:
>
> Patrick Connolly wrote:
>> On Mon, 08-Dec-2008 at 02:05AM +0800, Berwin A Turlach wrote:
>>
>>
Patrick Connolly wrote:
> On Mon, 08-Dec-2008 at 02:05AM +0800, Berwin A Turlach wrote:
>
> |> G'day Wacek,
> |>
> |> On Sat, 06 Dec 2008 10:49:24 +0100
> |> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
> |>
> |> []
> |> > >> there is, in principle, no problem in having a high-level language
Behalf Of emma jane
> Sent: Tuesday, December 09, 2008 7:02 AM
> To: Bernardo Rangel Tura; Wacek Kusnierczyk; Chuck Cleland
> Cc: R help
> Subject: Re: [R] Logical inconsistency
>
> Many thanks for your help, perhaps I should have set my query in
> context !
>
> I&
;
To: Wacek Kusnierczyk <[EMAIL PROTECTED]>
Cc: R help <[EMAIL PROTECTED]>
Sent: Saturday, 6 December, 2008 10:00:48
Subject: Re: [R] Logical inconsistency
On Fri, 2008-12-05 at 14:18 +0100, Wacek Kusnierczyk wrote:
> Berwin A Turlach wrote:
> > Dear Emma,
> >
> >
G'day Wacek,
On Mon, 08 Dec 2008 13:13:33 +0100
Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
> Berwin A Turlach wrote:
> >
> > I am not surprised about CS guys never learning about these
> > issues. As long as you play around with data bases (their
> > organisation &c), sorting algorithms, artif
Berwin A Turlach wrote:
>
> I am not surprised about CS guys never learning about these issues. As
> long as you play around with data bases (their organisation &c),
> sorting algorithms, artificial intelligence (at least when I attended a
> lecture on this) you do not need to know about these iss
G'day Wacek,
On Sun, 07 Dec 2008 21:09:36 +0100
Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
> g'evening.
Not the done thing.
> c'mon, a person from central europe can't possibly be unaware of this
> joke.
I wouldn't call Norway central Europe, but then I also guess that you
are not really
Patrick Connolly wrote:
> On Mon, 08-Dec-2008 at 02:05AM +0800, Berwin A Turlach wrote:
>
> |> G'day Wacek,
> |>
> |> On Sat, 06 Dec 2008 10:49:24 +0100
> |> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
> |>
> |> []
> |> > >> there is, in principle, no problem in having a high-level language
On Mon, 08-Dec-2008 at 02:05AM +0800, Berwin A Turlach wrote:
|> G'day Wacek,
|>
|> On Sat, 06 Dec 2008 10:49:24 +0100
|> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
|>
|> []
|> > >> there is, in principle, no problem in having a high-level language
|> > >> perform the computation in a logi
Stavros Macrakis wrote:
> On Sun, Dec 7, 2008 at 3:51 AM, Wacek Kusnierczyk <
> [EMAIL PROTECTED]> wrote:
>
>
(* (/ 2.0 3.0) 3.0) is not exact either, as aren't (* (/ 2.0 2.0)
>> 2.0)...
>>
>>> Actually, they *are* all exact in any system using IEEE floats.
>>>
>>
Berwin A Turlach wrote:
> G'day Wacek,
>
g'evening.
> On Sat, 06 Dec 2008 10:49:24 +0100
> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
>
> []
>
there is, in principle, no problem in having a high-level language
perform the computation in a logically consistent way.
On Sun, Dec 7, 2008 at 3:51 AM, Wacek Kusnierczyk <
[EMAIL PROTECTED]> wrote:
> >> (* (/ 2.0 3.0) 3.0) is not exact either, as aren't (* (/ 2.0 2.0)
> 2.0)...
> > Actually, they *are* all exact in any system using IEEE floats.
> not per definitionem of exactness as of r6rs, as of my understanding.
On 07-Dec-08 18:41:16, Charles C. Berry wrote:
> On Mon, 8 Dec 2008, Berwin A Turlach wrote:
>> G'day Wacek,
>> On Sat, 06 Dec 2008 10:49:24 +0100
>> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
>>
>> []
> there is, in principle, no problem in having a high-level language
> perform the
On Mon, 8 Dec 2008, Berwin A Turlach wrote:
G'day Wacek,
On Sat, 06 Dec 2008 10:49:24 +0100
Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
[]
there is, in principle, no problem in having a high-level language
perform the computation in a logically consistent way.
Is this now supposed to b
G'day Wacek,
On Sat, 06 Dec 2008 10:49:24 +0100
Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
[]
> >> there is, in principle, no problem in having a high-level language
> >> perform the computation in a logically consistent way.
> >
> > Is this now supposed to be a "Radio Eriwan" joke? As a
Stavros Macrakis wrote:
> On Sat, Dec 6, 2008 at 4:32 PM, Wacek Kusnierczyk <
> [EMAIL PROTECTED]> wrote:
>
>
>> Stavros Macrakis wrote:
>>
>>> On Sat, Dec 6, 2008 at 5:02 AM, Wacek Kusnierczyk <
>>> [EMAIL PROTECTED]> wrote:
>>>
yepp, though (2/3)*3 not evaluating to 2 is again
John C Nash wrote:
This actually goes back a very long way. Peter is right to remind us
that "optimizers" (in the sense of compilers) can corrupt algorithms
that are well-designed. Optimizing in tests is something some of us have
fought for nearly 40 years, but compiler writers don't do much
This actually goes back a very long way. Peter is right to remind us
that "optimizers" (in the sense of compilers) can corrupt algorithms
that are well-designed. Optimizing in tests is something some of us have
fought for nearly 40 years, but compiler writers don't do much
floating-point compu
[EMAIL PROTECTED] wrote:
This comment is orthogonal to most of the others. It seems that folk often
want to test for equality of "real" numbers. One important one is for
convergence tests. When writing my Compact Numerical Methods book I had to
avoid lots of logical tests, but wanted to compare t
This comment is orthogonal to most of the others. It seems that folk often
want to test for equality of "real" numbers. One important one is for
convergence tests. When writing my Compact Numerical Methods book I had to
avoid lots of logical tests, but wanted to compare two REALs. I found that
the
On Sat, Dec 6, 2008 at 4:32 PM, Wacek Kusnierczyk <
[EMAIL PROTECTED]> wrote:
> Stavros Macrakis wrote:
> > On Sat, Dec 6, 2008 at 5:02 AM, Wacek Kusnierczyk <
> > [EMAIL PROTECTED]> wrote:
> >> yepp, though (2/3)*3 not evaluating to 2 is again not a must, is it.
> > Why is that less a must than .
Stavros Macrakis wrote:
> On Sat, Dec 6, 2008 at 5:02 AM, Wacek Kusnierczyk <
> [EMAIL PROTECTED]> wrote:
>
>
>> yepp, though (2/3)*3 not evaluating to 2 is again not a must, is it.
>>
>
>
> Why is that less a must than .3-.2 == .1? On the contrary, the computing
> convention (and for that
On Sat, Dec 6, 2008 at 5:02 AM, Wacek Kusnierczyk <
[EMAIL PROTECTED]> wrote:
> yepp, though (2/3)*3 not evaluating to 2 is again not a must, is it.
Why is that less a must than .3-.2 == .1? On the contrary, the computing
convention (and for that matter the usual scientific and engineering
conv
Stavros Macrakis wrote:
> On Fri, Dec 5, 2008 at 8:18 AM, Wacek Kusnierczyk <
> [EMAIL PROTECTED]> wrote:
>
>
>> well, this answer the question only partially. this explains why a
>> system with finite precision arithmetic, such as r, will fail to be
>> logically correct in certain cases. it d
On Fri, 2008-12-05 at 14:18 +0100, Wacek Kusnierczyk wrote:
> Berwin A Turlach wrote:
> > Dear Emma,
> >
> > On Fri, 5 Dec 2008 04:23:53 -0800 (PST)
> > emma jane <[EMAIL PROTECTED]> wrote:
> >
> >
> >> Please could someone kindly explain the following inconsistencies
> >> I've discovered__whe
Berwin A Turlach wrote:
> G'day Wacek,
>
> On Fri, 05 Dec 2008 14:18:51 +0100
> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
>
>
>> well, this answer the question only partially. this explains why a
>> system with finite precision arithmetic, such as r, will fail to be
>> logically correct in c
On Fri, Dec 5, 2008 at 8:18 AM, Wacek Kusnierczyk <
[EMAIL PROTECTED]> wrote:
> well, this answer the question only partially. this explains why a
> system with finite precision arithmetic, such as r, will fail to be
> logically correct in certain cases. it does not explain why r, a
> language s
G'day Wacek,
On Fri, 05 Dec 2008 14:18:51 +0100
Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote:
> well, this answer the question only partially. this explains why a
> system with finite precision arithmetic, such as r, will fail to be
> logically correct in certain cases. it does not explain why r
Berwin A Turlach wrote:
> Dear Emma,
>
> On Fri, 5 Dec 2008 04:23:53 -0800 (PST)
> emma jane <[EMAIL PROTECTED]> wrote:
>
>
>> Please could someone kindly explain the following inconsistencies
>> I've discovered__when performing logical calculations in R:
>>
>> 8.8 - 7.8 > 1
>>
>>> TRUE
>
Dear Emma,
On Fri, 5 Dec 2008 04:23:53 -0800 (PST)
emma jane <[EMAIL PROTECTED]> wrote:
> Please could someone kindly explain the following inconsistencies
> I've discovered__when performing logical calculations in R:
>
> 8.8 - 7.8 > 1
> > TRUE
>
> 8.3 - 7.3 > 1
> > TRUE
Gladly: FAQ 7.31
htt
On 12/5/2008 7:23 AM, emma jane wrote:
> Dear colleagues
>
> Please could someone kindly explain the following inconsistencies I've
> discovered when performing logical calculations in R:
>
> 8.8 - 7.8 > 1
>> TRUE
>
> 8.3 - 7.3 > 1
>> TRUE
See R FAQ 7.31
(http://cran.r-project.org/doc/FAQ/R
Dear colleagues
Please could someone kindly explain the following inconsistencies I've
discovered when performing logical calculations in R:
8.8 - 7.8 > 1
> TRUE
8.3 - 7.3 > 1
> TRUE
Thank you,
Emma Jane
[[alternative HTML version deleted]]
40 matches
Mail list logo