1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* bignum.c (Init_Bignum), numeric.c (Init_Numeric): added fdiv as

aliases of quo.  [ruby-dev:30771]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-05-09 03:28:08 +00:00
parent a78970e211
commit 7de7d5ddeb
3 changed files with 11 additions and 0 deletions

View file

@ -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

View file

@ -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);

View file

@ -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);