This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Comparing doubles


> <<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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]