mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (int_pow): bugfix of overflow detection.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5d2069cd56
commit
ea2cb282ae
2 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
||||||
Fri Apr 27 12:54:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Apr 27 17:05:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* numeric.c (int_pow): bugfix of overflow detection.
|
||||||
|
|
||||||
* numeric.c (int_pow): rb_big_pow() may return other than Bignum.
|
* numeric.c (int_pow): rb_big_pow() may return other than Bignum.
|
||||||
|
|
||||||
|
|
|
@ -2283,7 +2283,7 @@ int_pow(long x, unsigned long y)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
long xz = x * z;
|
long xz = x * z;
|
||||||
if (xz < z || xz < x || !POSFIXABLE(xz)) {
|
if (!POSFIXABLE(xz) || xz / x != z) {
|
||||||
goto bignum;
|
goto bignum;
|
||||||
}
|
}
|
||||||
z = xz;
|
z = xz;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue