Thanks a lot, Marc, for this extra insight.

Note that Sun / Openoffice.org 's  approxEqual(a,b)
is not even symmetric in a and b  which I think is *really wrong*
((S's somewhat related  all.equal.numeric() method *is* symmetric))

>>>>> "Marc" == Marc Schwartz <[EMAIL PROTECTED]>
>>>>>     on 10 Jun 2003 14:41:53 -0500 writes:

    Marc> Hi all,

    Marc> I thought that I would follow up on this thread with some "refined"
    Marc> information.

    <.......>

    >> Copyright: 2002 by Sun Microsystems, Inc.
    >> 
    >> /** Test equality of two values with an accuracy of the magnitude of the
    >>     given values scaled by 2^-48 (4 bits roundoff stripped).
    >> 
    >>     @ATTENTION
    >>     approxEqual( value!=0.0, 0.0 ) _never_ yields true.
    >> */
    >> inline bool approxEqual(double a, double b)
    >> {
    >>   if ( a == b )
    >>     return true;
    >>   double x = a - b;
    >>     return (x < 0.0 ? -x : x)
    >>             < ((a < 0.0 ? -a : a) * (1.0 / (16777216.0 * 16777216.0)));
    >> }


Martin Maechler <[EMAIL PROTECTED]>     http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16    Leonhardstr. 27
ETH (Federal Inst. Technology)  8092 Zurich     SWITZERLAND
phone: x-41-1-632-3408          fax: ...-1228                   <><

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to