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

ruby-changes:25554

From: tadf <ko1@a...>
Date: Sat, 10 Nov 2012 19:29:22 +0900 (JST)
Subject: [ruby-changes:25554] tadf:r37611 (trunk): * complex.c: modified doc.

tadf	2012-11-10 19:29:13 +0900 (Sat, 10 Nov 2012)

  New Revision: 37611

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

  Log:
    * complex.c: modified doc.
    * ratioanl.c: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/complex.c
    trunk/rational.c

Index: complex.c
===================================================================
--- complex.c	(revision 37610)
+++ complex.c	(revision 37611)
@@ -481,7 +481,8 @@
  *
  * Returns x+i*y;
  *
- *    Complex(1, 2)  #=> (1+2i)
+ *    Complex(1, 2)    #=> (1+2i)
+ *    Complex('1+2i')  #=> (1+2i)
  */
 static VALUE
 nucomp_f_complex(int argc, VALUE *argv, VALUE klass)
@@ -1427,6 +1428,8 @@
  *    Complex(1, 0).to_r    #=> (1/1)
  *    Complex(1, 0.0).to_r  # RangeError
  *    Complex(1, 2).to_r    # RangeError
+ *
+ * See rationalize.
  */
 static VALUE
 nucomp_to_r(VALUE self)
@@ -1446,12 +1449,13 @@
  *    cmp.rationalize([eps])  ->  rational
  *
  * Returns the value as a rational if possible (the imaginary part
- * should be exactly zero).  The optional argument eps is always
- * ignored.
+ * should be exactly zero).
  *
  *    Complex(1.0/3, 0).rationalize  #=> (1/3)
  *    Complex(1, 0.0).rationalize    # RangeError
  *    Complex(1, 2).rationalize      # RangeError
+ *
+ * See to_r.
  */
 static VALUE
 nucomp_rationalize(int argc, VALUE *argv, VALUE self)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37610)
+++ ChangeLog	(revision 37611)
@@ -1,3 +1,8 @@
+Sat Nov 10 19:28:16 2012  Tadayoshi Funaba  <tadf@d...>
+
+	* complex.c: modified doc.
+	* ratioanl.c: ditto.
+
 Sat Nov 10 18:20:10 2012  Tadayoshi Funaba  <tadf@d...>
 
 	* ext/date/date_parse.c: edited about era.
Index: rational.c
===================================================================
--- rational.c	(revision 37610)
+++ rational.c	(revision 37611)
@@ -549,7 +549,8 @@
  *
  * Returns x/y;
  *
- *    Rational(1, 2)  #=> (1/2)
+ *    Rational(1, 2)   #=> (1/2)
+ *    Rational('1/2')  #=> (1/2)
  */
 static VALUE
 nurat_f_rational(int argc, VALUE *argv, VALUE klass)
@@ -1450,7 +1451,7 @@
  *    rat.rationalize       ->  self
  *    rat.rationalize(eps)  ->  rational
  *
- * Returns a simpler approximation of the value if an optional
+ * Returns a simpler approximation of the value if the optional
  * argument eps is given (rat-|eps| <= result <= rat+|eps|), self
  * otherwise.
  *
@@ -1793,7 +1794,7 @@
  * call-seq:
  *    nil.rationalize([eps])  ->  (0/1)
  *
- * Returns zero as a rational.  An optional argument eps is always
+ * Returns zero as a rational.  The optional argument eps is always
  * ignored.
  */
 static VALUE
@@ -1822,7 +1823,7 @@
  * call-seq:
  *    int.rationalize([eps])  ->  rational
  *
- * Returns the value as a rational.  An optional argument eps is
+ * Returns the value as a rational.  The optional argument eps is
  * always ignored.
  */
 static VALUE
@@ -1872,6 +1873,8 @@
  *    2.5.to_r    #=> (5/2)
  *    -0.75.to_r  #=> (-3/4)
  *    0.0.to_r    #=> (0/1)
+ *
+ * See rationalize.
  */
 static VALUE
 float_to_r(VALUE self)
@@ -1900,12 +1903,14 @@
  *    flt.rationalize([eps])  ->  rational
  *
  * Returns a simpler approximation of the value (flt-|eps| <= result
- * <= flt+|eps|).  if eps is not given, it will be chosen
+ * <= flt+|eps|).  if the optional eps is not given, it will be chosen
  * automatically.
  *
  *    0.3.rationalize          #=> (3/10)
  *    1.333.rationalize        #=> (1333/1000)
  *    1.333.rationalize(0.01)  #=> (4/3)
+ *
+ * See to_r.
  */
 static VALUE
 float_rationalize(int argc, VALUE *argv, VALUE self)

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

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