public void testGcdFirstZERO(){
  byte bBytes[]={15,24,123,57,-15,24,123,57,-15,24,123,57};
  int bSign=1;
  byte rBytes[]={15,24,123,57,-15,24,123,57,-15,24,123,57};
  BigInteger aNumber=BigInteger.ZERO;
  BigInteger bNumber=new BigInteger(bSign,bBytes);
  BigInteger result=aNumber.gcd(bNumber);
  byte resBytes[]=new byte[rBytes.length];
  resBytes=result.toByteArray();
  for (int i=0; i < resBytes.length; i++) {
    assertTrue(resBytes[i] == rBytes[i]);
  }
  assertEquals("incorrect sign",1,result.signum());
}

public void testGcdFirstZERO ( ) { byte bBytes [ ] = { 15 , 24 , 123 , 57 , - 15 , 24 , 123 , 57 , - 15 , 24 , 123 , 57 } ; int bSign = 1 ; byte rBytes [ ] = { 15 , 24 , 123 , 57 , - 15 , 24 , 123 , 57 , - 15 , 24 , 123 , 57 } ; BigInteger aNumber = BigInteger . ZERO ; BigInteger bNumber = new BigInteger ( bSign , bBytes ) ; BigInteger result = aNumber . gcd ( bNumber ) ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = result . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( "incorrect sign" , 1 , result . signum ( ) ) ; }
gcd : the first number is zero
