From 28fb6d6b9e06a632f96244a635a045622a6be276 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Fri, 3 Dec 2021 07:12:28 -0600 Subject: Adding links to literals and Kernel (#5192) * Adding links to literals and Kernel --- rational.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'rational.c') diff --git a/rational.c b/rational.c index b903decaf6..7817bdbcef 100644 --- a/rational.c +++ b/rational.c @@ -2715,13 +2715,19 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass) * a/b (b>0), where a is the numerator and b is the denominator. * Integer a equals rational a/1 mathematically. * - * In Ruby, you can create rational objects with the Kernel#Rational, - * to_r, or rationalize methods or by suffixing +r+ to a literal. - * The return values will be irreducible fractions. + * You can create a \Rational object explicitly with: + * + * - A {rational literal}[doc/syntax/literals_rdoc.html#label-Rational+Literals]. + * + * You can convert certain objects to Rationals with: + * + * - \Method {Rational}[Kernel.html#method-i-Rational]. + * + * Examples * * Rational(1) #=> (1/1) * Rational(2, 3) #=> (2/3) - * Rational(4, -6) #=> (-2/3) + * Rational(4, -6) #=> (-2/3) # Reduced. * 3.to_r #=> (3/1) * 2/3r #=> (2/3) * -- cgit v1.2.1