Rational

class Rational

Parent:
Numeric

BigDecimal extends the native Rational class to provide the to_d method.

When you require BigDecimal in your application, this method will be available on Rational objects.

A rational number can be represented as a paired integer number; a/b (b>0). Where a is numerator and b is denominator. Integer a equals rational a/1 mathematically.

In ruby, you can create rational object with Rational, #to_r, rationalize me