diff --git a/ChangeLog b/ChangeLog index 2065b0d0da..c0f734922d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Jun 20 22:49:27 2013 Tanaka Akira + + * bignum.c (bignorm): Don't call bigtrunc if the result is a fixnum. + Thu Jun 20 22:29:42 2013 Tanaka Akira * bignum.c (rb_uint2big): Refactored. diff --git a/bignum.c b/bignum.c index b0dc48c59b..be9c1e2740 100644 --- a/bignum.c +++ b/bignum.c @@ -322,7 +322,9 @@ static VALUE bignorm(VALUE x) { if (RB_TYPE_P(x, T_BIGNUM)) { - x = bigfixize(bigtrunc(x)); + x = bigfixize(x); + if (!FIXNUM_P(x)) + bigtrunc(x); } return x; }