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


<<As for compare, I don't claim to know the intricacies of IEEE NaN and
all that, but surely on older float formats at least, compare is
indeed internally just a subtract and test for zero?  Or a normalize
(if applicable) and bitwise compare?  (The latter is definitely the
case on the CDC 6600, to use an old example.)
>>

No, because a subtract and test for zero is subject to problems with both
underflow and overflow and can therefore result in considering unequal
numbers to be equal.


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