OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
* java/math/BigInteger.java(signum): Handle zero properly.
[pf3gnuchains/gcc-fork.git]
/
libjava
/
java
/
math
/
BigInteger.java
diff --git
a/libjava/java/math/BigInteger.java
b/libjava/java/math/BigInteger.java
index
55e3050
..
69e7f68
100644
(file)
--- a/
libjava/java/math/BigInteger.java
+++ b/
libjava/java/math/BigInteger.java
@@
-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)