* java/math/BigInteger.java(signum): Handle zero properly.
From-SVN: r32441
This commit is contained in:
parent
299b83b7fb
commit
d98729aa0e
2 changed files with 7 additions and 1 deletions
|
@ -285,7 +285,9 @@ public class BigInteger extends Number implements Comparable
|
|||
public int signum()
|
||||
{
|
||||
int top = words == null ? ival : words[ival-1];
|
||||
return top > 0 ? 1 : top < 0 ? -1 : 0;
|
||||
if (top == 0 && words == null)
|
||||
return 0;
|
||||
return top < 0 ? -1 : 1;
|
||||
}
|
||||
|
||||
private static int compareTo(BigInteger x, BigInteger y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue