operator == method

  1. @override
bool operator ==(
  1. Object that
)
override

Equals is based on val, unit (NaN == NaN).

Implementation

@override
bool operator ==(Object that) {
  if (that is! HNum) return false;
  HNum x = that;
  if (val.isNaN) return x.val.isNaN;
  if (val != x.val) return false;
  if (unit == null) return x.unit == null;
  if (x.unit == null) return false;
  return unit == x.unit;
}