compare method

Ordering<double> compare(
  1. double other
)

Implementation

Ordering<double> compare(double other) {
  final difference = this - other;

  if (difference > 0) {
    return Greater(difference);
  } else if (difference < 0) {
    return Less(-difference);
  } else {
    return const Equal();
  }
}