aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c2
-rw-r--r--numeric.c4
3 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 338dbc3818..9e9cf0a535 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed May 9 12:28:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (Init_Bignum), numeric.c (Init_Numeric): added fdiv as
+ aliases of quo. [ruby-dev:30771]
+
Tue May 8 23:39:09 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb (Date._parse): revised treatment of
diff --git a/bignum.c b/bignum.c
index b17fc4e9d8..861e56761e 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1531,6 +1531,7 @@ static VALUE rb_big_rshift(VALUE,VALUE);
/*
* call-seq:
* big.quo(numeric) -> float
+ * big.fdiv(numeric) -> float
*
* Returns the floating point result of dividing <i>big</i> by
* <i>numeric</i>.
@@ -2126,6 +2127,7 @@ Init_Bignum(void)
rb_define_method(rb_cBignum, "modulo", rb_big_modulo, 1);
rb_define_method(rb_cBignum, "remainder", rb_big_remainder, 1);
rb_define_method(rb_cBignum, "quo", rb_big_quo, 1);
+ rb_define_method(rb_cBignum, "fdiv", rb_big_quo, 1);
rb_define_method(rb_cBignum, "**", rb_big_pow, 1);
rb_define_method(rb_cBignum, "&", rb_big_and, 1);
rb_define_method(rb_cBignum, "|", rb_big_or, 1);
diff --git a/numeric.c b/numeric.c
index db847567d0..b4eb525c14 100644
--- a/numeric.c
+++ b/numeric.c
@@ -231,6 +231,7 @@ num_uminus(VALUE num)
/*
* call-seq:
* num.quo(numeric) => result
+ * num.fdiv(numeric) => result
*
* Equivalent to <code>Numeric#/</code>, but overridden in subclasses.
*/
@@ -2111,6 +2112,7 @@ fixdivmod(long x, long y, long *divp, long *modp)
/*
* call-seq:
* fix.quo(numeric) => float
+ * fix.fdiv(numeric) => float
*
* Returns the floating point result of dividing <i>fix</i> by
* <i>numeric</i>.
@@ -2960,6 +2962,7 @@ Init_Numeric(void)
rb_define_method(rb_cNumeric, "<=>", num_cmp, 1);
rb_define_method(rb_cNumeric, "eql?", num_eql, 1);
rb_define_method(rb_cNumeric, "quo", num_quo, 1);
+ rb_define_method(rb_cNumeric, "fdiv", num_quo, 1);
rb_define_method(rb_cNumeric, "div", num_div, 1);
rb_define_method(rb_cNumeric, "divmod", num_divmod, 1);
rb_define_method(rb_cNumeric, "modulo", num_modulo, 1);
@@ -3020,6 +3023,7 @@ Init_Numeric(void)
rb_define_method(rb_cFixnum, "modulo", fix_mod, 1);
rb_define_method(rb_cFixnum, "divmod", fix_divmod, 1);
rb_define_method(rb_cFixnum, "quo", fix_quo, 1);
+ rb_define_method(rb_cFixnum, "fdiv", fix_quo, 1);
rb_define_method(rb_cFixnum, "**", fix_pow, 1);
rb_define_method(rb_cFixnum, "abs", fix_abs, 0);