Comparing rational numbers