From ad0b5ebc503ae188db87f5de0715ead017dd5977 Mon Sep 17 00:00:00 2001 From: mrkn Date: Fri, 18 Mar 2016 12:57:40 +0000 Subject: * bignum.c (rb_big_to_s, Bignum#to_s): remove its definition because it is unified with Integer#to_s. * numeric.c (int_to_s): treat Bignum values directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'bignum.c') diff --git a/bignum.c b/bignum.c index 45be0b9cb4..e46c18837e 100644 --- a/bignum.c +++ b/bignum.c @@ -4966,35 +4966,6 @@ rb_big2str(VALUE x, int base) return rb_big2str1(x, base); } -/* - * call-seq: - * big.to_s(base=10) -> string - * - * Returns a string containing the representation of big radix - * base (2 through 36). - * - * 12345654321.to_s #=> "12345654321" - * 12345654321.to_s(2) #=> "1011011111110110111011110000110001" - * 12345654321.to_s(8) #=> "133766736061" - * 12345654321.to_s(16) #=> "2dfdbbc31" - * 78546939656932.to_s(36) #=> "rubyrules" - */ - -static VALUE -rb_big_to_s(int argc, VALUE *argv, VALUE x) -{ - int base; - - if (argc == 0) base = 10; - else { - VALUE b; - - rb_scan_args(argc, argv, "01", &b); - base = NUM2INT(b); - } - return rb_big2str(x, base); -} - static unsigned long big2ulong(VALUE x, const char *type) { @@ -7045,8 +7016,6 @@ Init_Bignum(void) { rb_cBignum = rb_define_class("Bignum", rb_cInteger); - rb_define_method(rb_cBignum, "to_s", rb_big_to_s, -1); - rb_define_alias(rb_cBignum, "inspect", "to_s"); rb_define_method(rb_cBignum, "coerce", rb_big_coerce, 1); rb_define_method(rb_cBignum, "-@", rb_big_uminus, 0); rb_define_method(rb_cBignum, "+", rb_big_plus, 1); -- cgit v1.2.3