public void testCase18(){
  byte aBytes[]={-127,100,56,7,98,-1,39,-128,127,75};
  byte bBytes[]={27,-15,65,39,100};
  int aSign=-1;
  int bSign=-1;
  byte rBytes[]={-13,20,-74,-57,-27};
  BigInteger aNumber=new BigInteger(aSign,aBytes);
  BigInteger bNumber=new BigInteger(bSign,bBytes);
  BigInteger result=aNumber.remainder(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 testCase18 ( ) { byte aBytes [ ] = { - 127 , 100 , 56 , 7 , 98 , - 1 , 39 , - 128 , 127 , 75 } ; byte bBytes [ ] = { 27 , - 15 , 65 , 39 , 100 } ; int aSign = - 1 ; int bSign = - 1 ; byte rBytes [ ] = { - 13 , 20 , - 74 , - 57 , - 27 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger bNumber = new BigInteger ( bSign , bBytes ) ; BigInteger result = aNumber . remainder ( 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 ( ) ) ; }
remainder of division of two negative numbers
