title: trying to subtract binary numbers with java program small error
body: <p>im making a simple add and subtract binary calculator. i got it to take in a number and convert it into binary number, and i even got it to add the numbers. When i try and get it to subtract it doesnt work. i get a weird output. heres the piece of the code.</p>
  
  <pre><code>int [ ] subtarctBin = new int [16];
  int carryX = 0;
  for (int i = 0; i &lt; 16; i++)
  {
      subtarctBin[i] = 0;
  }
  for (int i = 15; i &gt;= 0; i--)
  {
      int subtract = resultBinA[i] - resultBinB[i] - carryX;
      subtarctBin[i] = subtract % 2;
      carryX = subtract / 2;
  
  }
  System.out.println("");
  System.out.print("DIF:");
  for(int i=0; i&lt;16; i++)
  {
      System.out.print(subtarctBin[i]);
  }   
   }
  </code></pre>