diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-30 08:02:38 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-30 08:02:38 +0000 |
commit | f748c14cfdb5263a5d4120ef04c04e1f15bbb6cf (patch) | |
tree | c2bf10a9836a969ce046ff3579a2c418d044f64a | |
parent | 03c19dc55506a4ee1968c70cf5dced418f1a0a32 (diff) | |
download | ruby-f748c14cfdb5263a5d4120ef04c04e1f15bbb6cf.tar.gz |
* rational.c: Added documentation for rational literal.
[Bug #11075][fix GH-885][ci skip] Patch by @shishir127
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | rational.c | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Thu Apr 30 17:02:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org> + + * rational.c: Added documentation for rational literal. + [Bug #11075][fix GH-885][ci skip] Patch by @shishir127 + Thu Apr 30 16:39:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/socket/ipsocket.c (init_inetsock_internal): preserve errno diff --git a/rational.c b/rational.c index 74a0eab219..477ee11a6d 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. |