Thanks Richard.
I've some stuff too, but I need to look it up. A few years ago I built
a small test spreadsheet for Gnumeric when working with Jody Goldberg.
In the early 2000s, Jody contacted R (I think Duncan Murdoch) to ask if
it was OK for Gnumeric to use R's distribution function approximati
John,
I would be happy to participate in designing the test suite you suggest.
About a year ago I revised FAQ 7.31, based on my talk at the Aalberg R
conference. It now points, in addition to the Goldberg paper that has
been referenced there for a long time, to my appendix on precision.
Here is
Yes. I should have mentioned "optimizing" compilers, and I can agree with "never
trusting exact equality", though I consider conscious use of equality tests
useful.
Optimizing compilers have bitten me once or twice. Unfortunately, a lot of
floating-point work requires attention to detail. In the
> On 23 Apr 2017, at 14:49 , J C Nash wrote:
>
>
> So equality in floating point is not always "wrong", though it should be used
> with some attention to what is going on.
>
> Apologies to those (e.g., Peter D.) who have heard this all before. I suspect
> there are many to whom it is new.
Pet
For over 4 decades I've had to put up with people changing my codes because
I use equalities of floating point numbers in tests for convergence. (Note that
tests of convergence are a subset of tests for termination -- I'll be happy to
explain that if requested.) Then I get "your program isn't work
On Apr 21, 2017 12:01 PM, "JRG" wrote:
A good part of the problem in the specific case you initially presented
is that some non-integer numbers have an exact representation in the
binary floating point arithmetic being used. Basically, if the
fractional part is of the form 1/2^k for some integer
On 04/21/2017 02:03 PM, (Ted Harding) wrote:
I've been following this thread with interest. A nice
collection of things to watch out for, if you don't
want the small arithmetic errors due to finite-length
digital representations of fractions to cause trouble!
However, as well as these small disc
I've been following this thread with interest. A nice
collection of things to watch out for, if you don't
want the small arithmetic errors due to finite-length
digital representations of fractions to cause trouble!
However, as well as these small discrepancies, major
malfunctions can also result.
dsheets
>> do not encounter this behaviour as Excel silently rounds all your
>> calculations and makes approximate comparison without telling it does so.
>> Therefore most people usually do not have any knowledge of floating point
>> numbers representation.
>>
>> Cheers
&
ohnson
Sent: Thursday, April 20, 2017 11:56 PM
To: R-help
Subject: [R] Interesting quirk with fractions and rounding
Hello, R friends
My student unearthed this quirk that might interest you.
I wondered if this might be a bug in the R interpreter. If not a bug, it
certainly stands as a good exampl
t telling it does
>so.
>> Therefore most people usually do not have any knowledge of floating
>point
>> numbers representation.
>>
>> Cheers
>> Petr
>>
>> -Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paul
re most people usually do not have any knowledge of floating point
*>>* numbers representation.
*>>>>* Cheers
*>>* Petr
*>>>>* -Original Message-
*>>* From: R-help [mailto:r-help-bounces at r-project.org
<https://stat.ethz.ch/mailman/li
not have any knowledge of floating point
>> numbers representation.
>>
>> Cheers
>> Petr
>>
>> -Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paul
>> Johnson
>> Sent: Thursday, April 20, 2017 11:5
t
> numbers representation.
>
> Cheers
> Petr
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paul
> Johnson
> Sent: Thursday, April 20, 2017 11:56 PM
> To: R-help
> Subject: [R] Interesting quirk with fractions and roundi
numbers representation.
Cheers
Petr
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paul Johnson
Sent: Thursday, April 20, 2017 11:56 PM
To: R-help
Subject: [R] Interesting quirk with fractions and rounding
Hello, R friends
My student unearthed this
Department of Social and Health Services
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paul
Johnson
Sent: Thursday, April 20, 2017 2:56 PM
To: R-help
Subject: [R] Interesting quirk with fractions and rounding
Hello, R friends
My student unearthed t
Use all.equal(tolerance=0, aa, bb) to check for exact equality:
> aa <- 100*(23/40)
> bb <- (100*23)/40
> all.equal(aa,bb)
[1] TRUE
> all.equal(aa,bb,tolerance=0)
[1] "Mean relative difference: 1.235726e-16"
> aa < bb
[1] TRUE
The numbers there are rounded to 52 binary dig
> Daniel Nordlund, PhD
> Research and Data Analysis Division
> Services & Enterprise Support Administration
> Washington State Department of Social and Health Services
>
>
>> -----Original Message-----
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf
d, PhD
Research and Data Analysis Division
Services & Enterprise Support Administration
Washington State Department of Social and Health Services
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paul
> Johnson
> Sent: Thursday, April
Hello, R friends
My student unearthed this quirk that might interest you.
I wondered if this might be a bug in the R interpreter. If not a bug,
it certainly stands as a good example of the dangers of floating point
numbers in computing.
What do you think?
> 100*(23/40)
[1] 57.5
> (100*23)/40
[1
20 matches
Mail list logo