ruby-changes:42224
From: nobu <ko1@a...>
Date: Sat, 26 Mar 2016 10:55:19 +0900 (JST)
Subject: [ruby-changes:42224] nobu:r54298 (trunk): numeric.c: rb_int2str
nobu 2016-03-26 10:55:14 +0900 (Sat, 26 Mar 2016) New Revision: 54298 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54298 Log: numeric.c: rb_int2str * numeric.c (rb_int2str): conversion function to String for generic Integer. Modified files: trunk/ChangeLog trunk/internal.h trunk/numeric.c Index: numeric.c =================================================================== --- numeric.c (revision 54297) +++ numeric.c (revision 54298) @@ -3022,7 +3022,12 @@ int_to_s(int argc, VALUE *argv, VALUE x) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3022 rb_scan_args(argc, argv, "01", &b); base = NUM2INT(b); } + return rb_int2str(x, base); +} +VALUE +rb_int2str(VALUE x, int base) +{ if (FIXNUM_P(x)) { return rb_fix2str(x, base); } Index: internal.h =================================================================== --- internal.h (revision 54297) +++ internal.h (revision 54298) @@ -1014,6 +1014,7 @@ VALUE rb_int_mul(VALUE x, VALUE y); https://github.com/ruby/ruby/blob/trunk/internal.h#L1014 VALUE rb_int_idiv(VALUE x, VALUE y); VALUE rb_int_modulo(VALUE x, VALUE y); VALUE rb_int_round(VALUE num, int ndigits); +VALUE rb_int2str(VALUE num, int base); VALUE rb_dbl_hash(double d); VALUE rb_fix_plus(VALUE x, VALUE y); Index: ChangeLog =================================================================== --- ChangeLog (revision 54297) +++ ChangeLog (revision 54298) @@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 -Sat Mar 26 10:54:49 2016 Nobuyoshi Nakada <nobu@r...> +Sat Mar 26 10:55:12 2016 Nobuyoshi Nakada <nobu@r...> + + * numeric.c (rb_int2str): conversion function to String for + generic Integer. * numeric.c (rb_int_round): rounding function for generic Integers. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/