public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Robert Collins" <robert.collins@itdomain.com.au>
To: "Chuck Allison" <cda@freshsources.com>,
	"Richard R. Malloy" <rrmalloy@attbi.com>,
	"Randall R Schulz" <rrschulz@cris.com>
Cc: "Ross Smith" <rosss@pharos.co.nz>, <cygwin@cygwin.com>
Subject: RE: Strange behavior
Date: Sun, 03 Mar 2002 21:26:00 -0000	[thread overview]
Message-ID: <FC169E059D1A0442A04C40F86D9BA76008AB01@itdomain003.itdomain.net.au> (raw)

Floating point comparisons should _always_ be done via a confidence
interval, not bitwise equality. As for determinism, I don't know what
the logic circuits look like, so can't and won't comment :}.

Rob



> -----Original Message-----
> From: Chuck Allison [mailto:cda@freshsources.com] 
> Sent: Monday, March 04, 2002 4:08 PM
> To: Richard R. Malloy; Randall R Schulz
> Cc: Ross Smith; cygwin@cygwin.com
> Subject: Re: Strange behavior
> 
> 
> That's the point. They're always redued, so in both cases, 
> the expression 2.0/3.0 is evaluated. How can that be 
> non-deterministic?
> 
> ----- Original Message -----
> From: "Richard R. Malloy" <rrmalloy@attbi.com>
> To: "Randall R Schulz" <rrschulz@cris.com>
> Cc: "Ross Smith" <rosss@pharos.co.nz>; "'Chuck Allison'" 
> <cda@freshsources.com>; <cygwin@cygwin.com>
> Sent: Sunday, March 03, 2002 9:47 PM
> Subject: Re: Strange behavior
> 
> 
> > OK. I'm no IA32 expert can someone explain the following 
> results.  (Do 
> > the floating point registers use guard bits, randomly initialized 
> > perhaps?)
> >
> > bool operator==(const Rational& r1, const Rational& r2)
> > {
> >   double a=r1.toDouble(), b=r2.toDouble();
> >   cout << ?== a " << a << " " << ?== b " << b << endl;
> >   return a == b;
> >   //  return r1.toDouble() == r2.toDouble();
> >   /*  return ( r1.numerator == r2.numerator && r1.denominator == 
> > r2.denominator ); */ }

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

             reply	other threads:[~2002-03-04  5:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-03 21:26 Robert Collins [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-03 21:42 Gareth Pearce
2002-03-03 18:05 Ross Smith
2002-03-03 18:32 ` Randall R Schulz
2002-03-03 20:49   ` Richard R. Malloy
2002-03-03 21:08     ` Chuck Allison
2002-03-02 13:18 Chuck Allison
2002-03-02 15:09 ` David Means

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FC169E059D1A0442A04C40F86D9BA76008AB01@itdomain003.itdomain.net.au \
    --to=robert.collins@itdomain.com.au \
    --cc=cda@freshsources.com \
    --cc=cygwin@cygwin.com \
    --cc=rosss@pharos.co.nz \
    --cc=rrmalloy@attbi.com \
    --cc=rrschulz@cris.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).