summaryrefslogtreecommitdiffstats
path: root/rational.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-19 13:59:08 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-19 13:59:08 +0000
commit0f3e2698e99f012bae576812c0612e600e837508 (patch)
treef8d730c07e4f030d373f322fc63d9d7457214ec5 /rational.c
parent3e0c9e00984599ae72a7ccc34544404ae59b8684 (diff)
downloadruby-0f3e2698e99f012bae576812c0612e600e837508.tar.gz
ruby-0f3e2698e99f012bae576812c0612e600e837508.tar.xz
ruby-0f3e2698e99f012bae576812c0612e600e837508.zip
* rational.c; edited rdoc.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/rational.c b/rational.c
index 8bfe937d2..4e0d7d6a7 100644
--- a/rational.c
+++ b/rational.c
@@ -1798,6 +1798,11 @@ integer_denominator(VALUE self)
* flo.numerator => integer
*
* Returns the numerator of _flo_ as an +Integer+ object.
+ *
+ * For example:
+ *
+ * 0.3.numerator #=> 5404319552844595 # machine dependent
+ * lambda{|x| x.numerator.fdiv(x.denominator)}.call(0.3) #=> 0.3
*/
static VALUE
float_numerator(VALUE self)
@@ -1813,6 +1818,11 @@ float_numerator(VALUE self)
* flo.denominator => integer
*
* Returns the denominator of _flo_ as an +Integer+ object.
+ *
+ * For example:
+ *
+ * 0.3.denominator #=> 18014398509481984 # machine dependent
+ * lambda{|x| x.numerator.fdiv(x.denominator)}.call(0.3) #=> 0.3
*/
static VALUE
float_denominator(VALUE self)
@@ -1839,7 +1849,6 @@ nilclass_to_r(VALUE self)
return rb_rational_new1(INT2FIX(0));
}
-
/*
* call-seq:
* int.to_r => rational