mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
a670571ad3
commit
b553a34c63
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu Jul 5 15:56:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* numeric.c (int_pow): even number multiplication never be negative.
|
||||
|
||||
Thu Jul 5 10:42:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/{node,ruby}.h, ruby.c: added enum constants for gdb
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue