зеркало из https://github.com/github/ruby.git
rename rb_rational_add -> rb_rational_plus
* rational.c (rb_rational_plus): rename from rb_rational_add to be aligned with rb_fix_plus. * array.c (rb_ary_sum): ditto. * internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0a267b79f6
Коммит
d1d95056a3
|
@ -1,3 +1,12 @@
|
|||
Fri Apr 15 23:52:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
||||
|
||||
* rational.c (rb_rational_plus): rename from rb_rational_add
|
||||
to be aligned with rb_fix_plus.
|
||||
|
||||
* array.c (rb_ary_sum): ditto.
|
||||
|
||||
* internal.h: ditto.
|
||||
|
||||
Fri Apr 15 23:42:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
||||
|
||||
* rational.c (rb_rational_add): rename from nurat_add.
|
||||
|
|
2
array.c
2
array.c
|
@ -5762,7 +5762,7 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary)
|
|||
v = rb_to_float(v);
|
||||
goto float_value;
|
||||
}
|
||||
v = rb_rational_add(e, v);
|
||||
v = rb_rational_plus(e, v);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
|
@ -1204,7 +1204,7 @@ rb_pid_t rb_fork_ruby(int *status);
|
|||
void rb_last_status_clear(void);
|
||||
|
||||
/* rational.c */
|
||||
VALUE rb_rational_add(VALUE self, VALUE other);
|
||||
VALUE rb_rational_plus(VALUE self, VALUE other);
|
||||
VALUE rb_lcm(VALUE x, VALUE y);
|
||||
VALUE rb_rational_reciprocal(VALUE x);
|
||||
VALUE rb_cstr_to_rat(const char *, int);
|
||||
|
|
|
@ -742,7 +742,7 @@ f_addsub(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k)
|
|||
* Rational(20, 9) + 9.8 #=> 12.022222222222222
|
||||
*/
|
||||
VALUE
|
||||
rb_rational_add(VALUE self, VALUE other)
|
||||
rb_rational_plus(VALUE self, VALUE other)
|
||||
{
|
||||
if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
|
||||
{
|
||||
|
@ -2538,7 +2538,7 @@ Init_Rational(void)
|
|||
rb_define_method(rb_cRational, "numerator", nurat_numerator, 0);
|
||||
rb_define_method(rb_cRational, "denominator", nurat_denominator, 0);
|
||||
|
||||
rb_define_method(rb_cRational, "+", rb_rational_add, 1);
|
||||
rb_define_method(rb_cRational, "+", rb_rational_plus, 1);
|
||||
rb_define_method(rb_cRational, "-", nurat_sub, 1);
|
||||
rb_define_method(rb_cRational, "*", nurat_mul, 1);
|
||||
rb_define_method(rb_cRational, "/", nurat_div, 1);
|
||||
|
|
Загрузка…
Ссылка в новой задаче