* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2006-02-04 06:58:43 +00:00
parent 1a321a3f42
commit 1939b48f8d
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,11 @@
Sat Feb 4 15:56:37 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 15:06:50 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> Fri Feb 3 15:06:50 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/syck.c (syck_move_tokens): should reset p->cursor or etc * ext/syck/syck.c (syck_move_tokens): should reset p->cursor or etc

View file

@ -1953,7 +1953,7 @@ fix_to_s(argc, argv, x)
if (base == 2) { if (base == 2) {
/* rb_fix2str() does not handle binary */ /* 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); return rb_fix2str(x, base);
} }