summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-13 17:53:10 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-13 17:53:10 +0000
commitbd3af05e48c4705bd870b00d233e6ac9eb303199 (patch)
tree2c9da9276d2ea3ff4a15407a1861c521aa76340c
parent98b7080d2a5363ea422ba7111a0f9fa9a6966ac2 (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@12779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--numeric.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index efc83b0580..82737333a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jul 14 02:51:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * numeric.c (fix_pow): 0**2 should not raise floating point
+ exception. [ruby-dev:31216]
+
Sat Jul 14 02:25:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* numeric.c (int_pow): wrong overflow detection. [ruby-dev:31213]
diff --git a/numeric.c b/numeric.c
index 2dc1dd18bf..1f306df657 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2241,6 +2241,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 int_pow(a, b);
}