compareTo
Order by exact cross-multiplication: a/b <=> c/d compares a*d against c*b. Both denominators are positive, so no sign flip is needed. Products are overflow-checked, so an out-of-range comparison throws rather than wrapping to a wrong verdict.