Re: [R] Interesting quirk with fractions and rounding / using == for floating point

2017-04-23 Thread J C Nash
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

Re: [R] Interesting quirk with fractions and rounding / using == for floating point

2017-04-23 Thread Richard M. Heiberger
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

Re: [R] Interesting quirk with fractions and rounding / using == for floating point

2017-04-23 Thread J C Nash
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

Re: [R] Interesting quirk with fractions and rounding / using == for floating point

2017-04-23 Thread peter dalgaard
> 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

Re: [R] Interesting quirk with fractions and rounding / using == for floating point

2017-04-23 Thread J C Nash
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