From 254bed302752a401b5fcc3b6c65a9c93711d91d6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 30 May 2020 18:34:32 +0900 Subject: [PATCH] Renamed `nurat_sub` compliant with `rb_rational_plus` --- internal/rational.h | 1 + rational.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/rational.h b/internal/rational.h index 2171a4e997..99c5eec8cb 100644 --- a/internal/rational.h +++ b/internal/rational.h @@ -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); diff --git a/rational.c b/rational.c index 1a95afd4aa..02c9003b7e 100644 --- a/rational.c +++ b/rational.c @@ -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);