In order to make sure the difference between two numbers is positive, we use abs on their subtraction.
Is there an equivalent function that makes sure the ratio between two numbers is (say) larger than one?

No, I would just work with logarithms. This is pretty standard in statistics, as probabilities/likelihoods multiplied or divided run out of the range of Float64 very quickly (usually a few hundred or at best thousand values), whereas logs take you very far, and you just add/subtract.

If the ratios are trivial, you would of course be OK with something like