summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-26 01:55:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-26 01:55:14 +0000
commit23e5b482ca4905c72395efddaabc98c13ceef19d (patch)
tree3a0dbb2a1e1f2a9c9a3ff0e4e1d4556cbca4fe48 /numeric.c
parente9dc649d66ee051747f49e2c8e7fbeb8b8923eec (diff)
numeric.c: rb_int2str
* numeric.c (rb_int2str): conversion function to String for generic Integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index 7dc8b138a4..e368b59c3d 100644
--- a/numeric.c
+++ b/numeric.c
@@ -3022,7 +3022,12 @@ int_to_s(int argc, VALUE *argv, VALUE x)
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);
}