summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-10 10:29:13 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-10 10:29:13 +0000
commite864787c849bd723747d753837bc8bdce0428589 (patch)
tree8ea2c2cb8f27b1a48af1b029b3220f8a1c7ebb93 /rational.c
parentb04aa4d2cfcae41f039f964fdfa99e3428fd8710 (diff)
* complex.c: modified doc.
* ratioanl.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/rational.c b/rational.c
index c06794f31d..845b4d80b4 100644
--- a/rational.c
+++ b/rational.c
@@ -549,7 +549,8 @@ f_rational_new_no_reduce2(VALUE klass, VALUE x, VALUE y)
*
* 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 @@ nurat_rationalize_internal(VALUE a, VALUE b, VALUE *p, VALUE *q)
* 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 @@ nilclass_to_r(VALUE self)
* 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 @@ integer_to_r(VALUE self)
* 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 @@ float_decode(VALUE self)
* 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 @@ float_to_r(VALUE self)
* 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)