From 98b7080d2a5363ea422ba7111a0f9fa9a6966ac2 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 13 Jul 2007 17:27:40 +0000 Subject: * numeric.c (int_pow): wrong overflow detection. [ruby-dev:31215] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index c4210279a4..2dc1dd18bf 100644 --- a/numeric.c +++ b/numeric.c @@ -2196,7 +2196,7 @@ int_pow(x, y) do { while (y % 2 == 0) { long x2 = x * x; - if (x2 < x || !POSFIXABLE(x2)) { + if (x2/x != x || !POSFIXABLE(x2)) { VALUE v; bignum: v = rb_big_pow(rb_int2big(x), LONG2NUM(y)); -- cgit v1.2.3