summaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-26 08:14:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-26 08:14:14 +0000
commit8984f0e8a4b48bfea63c3363182b1675f8cf8749 (patch)
tree91dce2eaad0ac582d4da9199314417249abd0406 /numeric.c
parent7a58b0fed30e6ce43610005a1a971bf197044f51 (diff)
downloadruby-8984f0e8a4b48bfea63c3363182b1675f8cf8749.tar.gz
ruby-8984f0e8a4b48bfea63c3363182b1675f8cf8749.tar.xz
ruby-8984f0e8a4b48bfea63c3363182b1675f8cf8749.zip
* numeric.c (fix_pow): returns 1.0 for 0**0.0.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13786 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 3c0cfdaaa..4e30d4e23 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2361,6 +2361,7 @@ fix_pow(VALUE x, VALUE y)
x = rb_int2big(FIX2LONG(x));
return rb_big_pow(x, y);
case T_FLOAT:
+ if (RFLOAT(y)->value == 0.0) return rb_float_new(1.0);
if (a == 0) {
return rb_float_new(RFLOAT(y)->value < 0 ? (1.0 / zero) : 0.0);
}