You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gmelika, even though it displays as "0", it is apparently actually a -0. You will see this if you divide one by that value as Yaffle has done. Here is a JSFiddle: http://jsfiddle.net/ue0mru55/
It basically shows that
new BigInteger("-1").compareTo(new BigInteger("-1")) => 0
and
1 / new BigInteger("-1").compareTo(new BigInteger("-1")) => -Infinity
Would it be possible and reasonable to wrap the result of compareTo() in Math.abs()?
Yaffle, just for my reference, does it matter if compareTo() returns -0?
negative zero is a result of "compareTo"
The text was updated successfully, but these errors were encountered: