diff --git a/ChangeLog b/ChangeLog index a8f2f536d8..4251d89598 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -Fri Apr 27 12:54:35 2007 Nobuyoshi Nakada +Fri Apr 27 17:05:41 2007 Nobuyoshi Nakada + + * numeric.c (int_pow): bugfix of overflow detection. * numeric.c (int_pow): rb_big_pow() may return other than Bignum. diff --git a/numeric.c b/numeric.c index 1425348a95..db847567d0 100644 --- a/numeric.c +++ b/numeric.c @@ -2283,7 +2283,7 @@ int_pow(long x, unsigned long y) } { long xz = x * z; - if (xz < z || xz < x || !POSFIXABLE(xz)) { + if (!POSFIXABLE(xz) || xz / x != z) { goto bignum; } z = xz;