Specification does not say that Bignum may have value "-0".
It can be created by the constructor or achieved as the result of
operation (eg -1*0).
Class Bignum declares only one constant ZERO.
=== Here is the minimized test demonstrating the bug ===
import java.lang.Bignum;
class java_lang_Bignum_equals {
public static void main(String args[]) {
Bignum b1=new Bignum("-0");
Bignum b2=new Bignum("0");
System.out.println(b1.equals(b2));
}
}
=== Here is the output of the test ===
false
It can be created by the constructor or achieved as the result of
operation (eg -1*0).
Class Bignum declares only one constant ZERO.
=== Here is the minimized test demonstrating the bug ===
import java.lang.Bignum;
class java_lang_Bignum_equals {
public static void main(String args[]) {
Bignum b1=new Bignum("-0");
Bignum b2=new Bignum("0");
System.out.println(b1.equals(b2));
}
}
=== Here is the output of the test ===
false