diff options
author | Burdette Lamar <BurdetteLamar@Yahoo.com> | 2021-12-03 07:12:28 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-03 07:12:28 -0600 |
commit | 28fb6d6b9e06a632f96244a635a045622a6be276 (patch) | |
tree | 1c96616dc764d2b67c83fe9443b7f5ae1f8c9ea8 /rational.c | |
parent | 324d57df0b28982590609d7ae080f82074a82a5c (diff) |
Adding links to literals and Kernel (#5192)
* Adding links to literals and Kernel
Notes
Notes:
Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 14 |
1 files changed, 10 insertions, 4 deletions
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) * |