mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
* java/math/BigInteger.java(signum): Handle zero properly.
From-SVN: r32441
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user