[RESOLVED] BigInteger remainder results in zero
Code:
BigInteger nbr = BigInteger.valueOf(4);
BigInteger i = BigInteger.valueOf(2);
nbr.remainder(i) == BigInteger.ZERO
this returns false, it should return true, the remainder is zero...
why is it returning false?
although if u check each one alone, they are ZEROS and they are equal!!!
why is it returning false?
Re: BigInteger remainder results in zero
use
Code:
nbr.remainder(i).equals(BigInteger.ZERO);
to compare values the "==" compares references