Why isn't the divide() function working in Java BigInteger? <p>I'm attempting to divide the variable 'c' by 2(stored in 'd'). For some reason that doesn't happen. I'm passing 10 and 2 for input right now. </p> <pre><code>import java.util.*; import java.lang.*; import java.io.*; import java.math.BigInteger; class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); BigInteger a = new BigInteger(sc.next()); BigInteger b = sc.nextBigInteger(); BigInteger d = new BigInteger("2"); System.out.println(d); BigInteger c = a.subtract(b); c.divide(d); System.out.println(c); a.subtract(c); System.out.println(a); System.out.println(c); } } </code></pre> <p>Any help would be appreciated. Thanks in advance!</p>