1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead

of FIX2INT to avoid conversion error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mrkn 2013-11-23 16:08:23 +00:00
parent 4efba669ec
commit 10ca8a4b07
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Sun Nov 24 01:03:00 2013 Kenta Murata <mrkn@mrkn.jp>
* ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead
of FIX2INT to avoid conversion error.
Sun Nov 24 00:44:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros

View file

@ -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;