* java/math/BigInteger.java(signum): Handle zero properly.

From-SVN: r32441
This commit is contained in:
Warren Levy 2000-03-09 04:35:30 +00:00 committed by Warren Levy
parent 299b83b7fb
commit d98729aa0e
2 changed files with 7 additions and 1 deletions

View file

@ -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)