compareTo method
Compara como o PostgreSQL: -Infinity < finitos < Infinity < NaN.
Implementation
@override
int compareTo(PgDecimal other) {
if (_kind != _finite || other._kind != _finite) {
return _rank.compareTo(other._rank);
}
if (_scale == other._scale) return _unscaled.compareTo(other._unscaled);
final scale = _scale > other._scale ? _scale : other._scale;
return _upscale(_unscaled, _scale, scale)
.compareTo(_upscale(other._unscaled, other._scale, scale));
}