compareTo method
Compares this Scalar to q2
by comparing MKS values or if q2 is a num or Number, by comparing
the values directly. If q2
is a Quantity it need not have Scalar dimensions.
This method overrides the Quantity.compareTo() method in order to allow for Scalar to be compared directly to nums and Numbers.
Returns a negative integer, zero, or a positive integer as this Quantity is
less than, equal to, or greater than q2
.
Implementation
@override
int compareTo(dynamic q2) {
if (q2 is num || q2 is Number) return valueSI.compareTo(q2);
return super.compareTo(q2);
}