diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-26 08:14:14 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-26 08:14:14 +0000 |
| commit | 8984f0e8a4b48bfea63c3363182b1675f8cf8749 (patch) | |
| tree | 91dce2eaad0ac582d4da9199314417249abd0406 | |
| parent | 7a58b0fed30e6ce43610005a1a971bf197044f51 (diff) | |
| download | ruby-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
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | numeric.c | 1 |
2 files changed, 4 insertions, 1 deletions
@@ -1,4 +1,6 @@ -Fri Oct 26 17:01:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> +Fri Oct 26 17:14:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * numeric.c (fix_pow): returns 1.0 for 0**0.0. * numeric.c (fix_pow): returns infinity for 0**-1. [ruby-dev:32084] @@ -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); } |
