[前][次][番号順一覧][スレッド一覧]

ruby-changes:38325

From: hsbt <ko1@a...>
Date: Thu, 30 Apr 2015 17:02:47 +0900 (JST)
Subject: [ruby-changes:38325] hsbt:r50406 (trunk): * rational.c: Added documentation for rational literal.

hsbt	2015-04-30 17:02:38 +0900 (Thu, 30 Apr 2015)

  New Revision: 50406

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50406

  Log:
    * rational.c: Added documentation for rational literal.
      [Bug #11075][fix GH-885][ci skip] Patch by @shishir127

  Modified files:
    trunk/ChangeLog
    trunk/rational.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50405)
+++ ChangeLog	(revision 50406)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Apr 30 17:02:33 2015  SHIBATA Hiroshi  <hsbt@r...>
+
+	* 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@r...>
 
 	* ext/socket/ipsocket.c (init_inetsock_internal): preserve errno
Index: rational.c
===================================================================
--- rational.c	(revision 50405)
+++ rational.c	(revision 50406)
@@ -2465,13 +2465,14 @@ nurat_s_convert(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/rational.c#L2465
  * 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.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]