compare method
Implementation
int compare(double other, {double precision = precisionErrorTolerance}) {
if (isNaN || other.isNaN) {
throw UnsupportedError('Compared with Infinity or NaN');
}
final double n = this - other;
if (n.abs() < precision) {
return 0;
}
return n < 0 ? -1 : 1;
}