BigInteger bigInteger = ...; if(bigInteger.longValue() > 0) { //original code //bigger than 0 } //should I change to this? if(bigInteger.compareTo(BigInteger.
If you are using BigInteger, this assumes you need bigger numbers than long can handle. So don't use longValue(). Use compareTo. With your example it better be:
BigInteger
long
longValue()
compareTo
if (bigInteger.compareTo(BigInteger.ZERO) > 0) { }