Rational numbers appear in reduced forms

39 Views Asked by At

I want to save a rational number 3/12 in a variable using this code:

rNo = Rational(3, 12)
# => 1/4

but ruby reduces the number to 1/4.

Can anybody please tell me how to keep the numbers as I write them?

0

There are 0 best solutions below