diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-05 06:56:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-05 06:56:10 +0000 |
commit | b553a34c63da315637afeced46afd05d33f7c623 (patch) | |
tree | 4c625609d0a9e9c414dadc636c6b9e632dc03fd6 /numeric.c | |
parent | a670571ad3ceab1ac1f1266f2b263640f2b11cc6 (diff) | |
download | ruby-b553a34c63da315637afeced46afd05d33f7c623.tar.gz |
* numeric.c (int_pow): even number multiplication never be negative.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2304,7 +2304,7 @@ int_pow(long x, unsigned long y) z = xz; } } while (--y); - if (neg) z = -z; + if (neg && (y & 1)) z = -z; return LONG2NUM(z); } |