hashCode property
The hash codes for two Numbers will be equal when the represented values are equal, even if the Number subtypes are different.
Additionally, Numbers having integer values will have the same hashcode as
the corresponding dart:core int
.
Implementation
@override
int get hashCode {
if (imaginary.value.toDouble() == 0) {
if (real is Precise) return real.hashCode;
return Precise.num(real.toDouble()).hashCode;
} else {
if (real.toDouble() == 0) {
return hashObjects(<Object>[0, imaginary.value]);
}
return hashObjects(<Object>[real, imaginary.value]);
}
}