Floating-point equality and inequality -
floating-point equality comparison has weird edge cases e.g. 2 nan values compare not equal if identical bit patterns.
can assumed, however, inequality inverse of equality? is, assuming standard ieee 64-bit floating-point numbers implemented on mainstream architectures such x64, 1 of a == b
, a != b
true regardless of bit patterns present?
yes, true, there no number interpretations of bit patterns operator == not return exact opposite !=.
there exceptions bit patterns compare equal different bit patterns (negative 0 0x80... equal 0 0x00...) or same bit pattern compare unequal (nans) mentioned, != inversion of ==.
Comments
Post a Comment