зеркало из https://github.com/github/ruby.git
Renamed `nurat_sub` compliant with `rb_rational_plus`
This commit is contained in:
Родитель
53d2bfd540
Коммит
254bed3027
|
@ -27,6 +27,7 @@ struct RRational {
|
|||
VALUE rb_rational_canonicalize(VALUE x);
|
||||
VALUE rb_rational_uminus(VALUE self);
|
||||
VALUE rb_rational_plus(VALUE self, VALUE other);
|
||||
VALUE rb_rational_minus(VALUE self, VALUE other);
|
||||
VALUE rb_rational_mul(VALUE self, VALUE other);
|
||||
VALUE rb_lcm(VALUE x, VALUE y);
|
||||
VALUE rb_rational_reciprocal(VALUE x);
|
||||
|
|
|
@ -771,8 +771,8 @@ rb_rational_plus(VALUE self, VALUE other)
|
|||
* Rational(9, 8) - 4 #=> (-23/8)
|
||||
* Rational(20, 9) - 9.8 #=> -7.577777777777778
|
||||
*/
|
||||
static VALUE
|
||||
nurat_sub(VALUE self, VALUE other)
|
||||
VALUE
|
||||
rb_rational_minus(VALUE self, VALUE other)
|
||||
{
|
||||
if (RB_INTEGER_TYPE_P(other)) {
|
||||
{
|
||||
|
@ -2731,7 +2731,7 @@ Init_Rational(void)
|
|||
|
||||
rb_define_method(rb_cRational, "-@", rb_rational_uminus, 0);
|
||||
rb_define_method(rb_cRational, "+", rb_rational_plus, 1);
|
||||
rb_define_method(rb_cRational, "-", nurat_sub, 1);
|
||||
rb_define_method(rb_cRational, "-", rb_rational_minus, 1);
|
||||
rb_define_method(rb_cRational, "*", rb_rational_mul, 1);
|
||||
rb_define_method(rb_cRational, "/", nurat_div, 1);
|
||||
rb_define_method(rb_cRational, "quo", nurat_div, 1);
|
||||
|
|
Загрузка…
Ссылка в новой задаче