diff --git a/ChangeLog b/ChangeLog index 7233bcc89c..27cce5a49b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Nov 24 01:03:00 2013 Kenta Murata + + * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead + of FIX2INT to avoid conversion error. + Sun Nov 24 00:44:30 2013 Nobuyoshi Nakada * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index b4656ea0c3..29240c7da4 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -2194,7 +2194,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self) return ToValue(y); } -retry: + retry: switch (TYPE(vexp)) { case T_FIXNUM: break; @@ -2381,7 +2381,7 @@ retry: } } - int_exp = FIX2INT(vexp); + int_exp = FIX2LONG(vexp); ma = int_exp; if (ma < 0) ma = -ma; if (ma == 0) ma = 1;