summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-15 20:00:28 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-15 20:00:28 +0000
commitdb9f4b559d0bbc1d5317c03ad31070ad607cf5ca (patch)
tree9c8e1ebd2d5758b860763f021b9c64935e3658ed /numeric.c
parent6c80040ef41db245fa442ad6e7e7b4d1215ce5d7 (diff)
* numeric.c (fix_pow): 0**2 should not raise floating point
exception. [ruby-dev:31216] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@12984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index fae862ae0a..23362a0bf5 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2202,6 +2202,7 @@ fix_pow(x, y)
if (b == 0) return INT2FIX(1);
if (b == 1) return x;
a = FIX2LONG(x);
+ if (a == 0) return INT2FIX(0);
if (b > 0) {
return rb_big_pow(rb_int2big(a), y);
}