Using mathn in a program is normally not a good idea because it changes
integer division globally and other operators.

Without mathn you can use for example:

    Rational(3, 4)
    "3/4".to_r
    0.75r # Ruby 2.1 only

It is important to note that in Ruby 2.1 the literal 0.75r is exact.

Let me explain: Expressions like 0.1.to_r should be totally avoided (unless
for some reason that's what you actually mean), because that is a method
(#to_r) invoked on a float (0.1), and if you pass through a float accuracy
is generally lost due to the limitations of the representation of
floating-point numbers. That's why you get
3602879701896397/36028797018963968.

On the other hand 0.1r is safe, that is a rational literal, no float is
involved, it is exact.