[comp.lang.c] Fuzzy Floating Point

V125KJG8%UBVMS.BITNET@wiscvm.wisc.EDU (04/17/87)

>Think twice before advocating fuzzy equality -- it may solve some
>problems but it causes others.  For instance, given
>
>    a == b
>
>and
>
>    b == c
>
>shouldn't one be able to assume
>
>    a == c
>
>?

I use a microcomputer C and its floating point accumulators are kept in memory
and are always 64 bits long for comparisons.  As an individual at watmath.uucp
pointed out to me, it's possible on a processor, say, the 68020/68881
combination, where the floating-point processor internally computes to 80 bits
and it's moved back out to a 64-bit area.  We now compare a 64-bit float to an
80-bit float, and if, for example, the IEEE INX (Inexact Result) flag is
set, we ARE NOT going to be equal here!  As long as we are doing 64-bit to
64-bit comparisions, and a companion INX is cleared, that is the only time we
are guaranteed of equality.  Once values go beyond the range of the mantissa,
the INX flag will be set, and floating-point equality is lost.

Just my few cents' worth before Easter...
  --Curtis R. Anderson
    State University of New York at Buffalo
    (V125KJG8@UBVMS.BITNET)
    (C125KJG8@UBVM.BITNET)