From 300df3cee23ab82f80c85c86f5efc9944b50d390 Mon Sep 17 00:00:00 2001 From: shishir127 Date: Sat, 25 Apr 2015 17:34:21 +0530 Subject: [PATCH] Added documentation for rational literal --- rational.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rational.c b/rational.c index 74a0eab2197ce1..477ee11a6d720e 100644 --- a/rational.c +++ b/rational.c @@ -2465,13 +2465,14 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass) * 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 or - * rationalize method. The return values will be irreducible. + * In ruby, you can create rational object with Rational, to_r, + * rationalize method or suffixing r to a literal. The return values will be irreducible. * * Rational(1) #=> (1/1) * Rational(2, 3) #=> (2/3) * Rational(4, -6) #=> (-2/3) * 3.to_r #=> (3/1) + * 2/3r #=> (2/3) * * You can also create rational object from floating-point numbers or * strings.