== package:ieee754

An exact equality comparison. For real IEEE types, two values are equivalent in the following cases:
  • both values are +0;
  • both values are -0;
  • both values are nonzero and equal to each other (according to ==);
  • both values are NaN with the same payload and sign.
For complex IEEE types, two values are equivalent if their real and imaginary parts are equivalent.
An approximate equality comparison operator. For real IEEE types, two values are approximately equal in the following cases:
  • at least half of their significand bits agree;
  • both values are less than epsilon;
  • both values are NaN.
For complex IEEE types, two values are approximately equal in the followiing cases:
  • their magnitudes are approximately equal and the angle between them is less than 32*epsilon;
  • both magnitudes are less than epsilon;
  • both have a NaN real or imaginary part.
Admitedly, the 32 is a bit of a hack. Future versions of the library may switch to a more principled test of the angle.