This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Comparing doubles
- From: Tim Hollebeek <tim at hollebeek dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: pkoning at equallogic dot com, gcc at gcc dot gnu dot org, geoffk at geoffk dot org, lars at nocrew dot org
- Date: Sun, 7 Jul 2002 20:38:50 -0400
- Subject: Re: Comparing doubles
- References: <20020707232510.324E1F28D5@nile.gnat.com>
- Reply-to: tim at hollebeek dot com
> <<Truncation before compare allows {a==b, b==c, c!=a}, and all other
> sorts of unreasonable things. Regardless of whether the standard
> strictly requires it or not, it is reasonable to expect equality to be
> an equivalence operation.
> >>
>
> But it is not necessarily the case that a==a (in the case of a NaN) so
> your equivalence relation does not cover NaN's. That's still reasonable,
> but it is worth noticing the exception.
I was going to mention it, but couldn't find a good way of saying
"when restricted to 'real' values." Thanks.