public void testCase21(){
  byte aBytes[]={120,34,78,-23,-111,45,127,23,45,-3};
  byte rBytes[]={120,34,78,-23,-111,45,127,23,45,-3};
  int aSign=1;
  BigInteger aNumber=new BigInteger(aSign,aBytes);
  BigInteger bNumber=BigInteger.ZERO;
  BigInteger result=aNumber.subtract(bNumber);
  byte resBytes[]=new byte[rBytes.length];
  resBytes=result.toByteArray();
  for (int i=0; i < resBytes.length; i++) {
    assertTrue(resBytes[i] == rBytes[i]);
  }
  assertEquals(1,result.signum());
}

public void testCase21 ( ) { byte aBytes [ ] = { 120 , 34 , 78 , - 23 , - 111 , 45 , 127 , 23 , 45 , - 3 } ; byte rBytes [ ] = { 120 , 34 , 78 , - 23 , - 111 , 45 , 127 , 23 , 45 , - 3 } ; int aSign = 1 ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger bNumber = BigInteger . ZERO ; BigInteger result = aNumber . subtract ( bNumber ) ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = result . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( 1 , result . signum ( ) ) ; }
subtract zero from a number . the number is positive .
