summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-04-09 16:10:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-04-09 16:10:40 +0000
commit234c47e9fba274e1d07bdc39846cb9dbe3db569e (patch)
tree4aeb22100633f4e4d604b93b72505ba9eba117c0 /bignum.c
parent468a0bd4fa5f69407de50bb9645ab99efe327092 (diff)
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689] * bignum.c (rb_big_pow): second operand may be too big even if it's a Fixnum. [ruby-talk:187984] * README.EXT: update symbol description. [ruby-talk:188104] * COPYING: explicitly note GPLv2. [ruby-talk:187922] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index 425676d..6a7a83c 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1606,6 +1606,11 @@ rb_big_pow(x, y)
if (yy > 0) {
VALUE z = x;
+ if (RBIGNUM(x)->len * SIZEOF_BDIGITS * yy > 1024*1024) {
+ rb_warn("in a**b, b may be too big");
+ d = (double)yy;
+ break;
+ }
for (;;) {
yy -= 1;
if (yy == 0) break;