summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-04 06:58:43 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-04 06:58:43 +0000
commitb542538fb6429f0618134f3ac49247b344eca71d (patch)
tree8e3c335fef1b6a25b4c044e389019cafa2bd6378
parent7a95737dc9f2fb078d2613ee15ea259c53b3366e (diff)
downloadruby-b542538fb6429f0618134f3ac49247b344eca71d.tar.gz
ruby-b542538fb6429f0618134f3ac49247b344eca71d.tar.xz
ruby-b542538fb6429f0618134f3ac49247b344eca71d.zip
* numeric.c (fix_to_s): (2**32).to_s(2) fails with exception where
sizeof(int) == 4 < sizeof(long). [ruby-core:7300] I think the function name of rb_int2big is quite misleading. This should be "rb_long2big". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--numeric.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b75b3dc9..b89393004 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Feb 4 15:52:56 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * numeric.c (fix_to_s): (2**32).to_s(2) fails with exception where
+ sizeof(int) == 4 < sizeof(long). [ruby-core:7300]
+
+ I think the function name of rb_int2big is quite misleading.
+ This should be "rb_long2big".
+
Fri Feb 3 19:25:53 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ruby.h: fixed prototype.
diff --git a/numeric.c b/numeric.c
index 3a0536e10..10310338c 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1884,7 +1884,7 @@ fix_to_s(int argc, VALUE *argv, VALUE x)
if (base == 2) {
/* rb_fix2str() does not handle binary */
- return rb_big2str(rb_int2big(FIX2INT(x)), 2);
+ return rb_big2str(rb_int2big(FIX2LONG(x)), 2);
}
return rb_fix2str(x, base);
}