public void testValueOfLongNegative2(){
  long longVal=-58930018L;
  BigInteger aNumber=BigInteger.valueOf(longVal);
  byte rBytes[]={-4,124,-52,-98};
  byte resBytes[]=new byte[rBytes.length];
  resBytes=aNumber.toByteArray();
  for (int i=0; i < resBytes.length; i++) {
    assertTrue(resBytes[i] == rBytes[i]);
  }
  assertEquals("incorrect sign",-1,aNumber.signum());
}

public void testValueOfLongNegative2 ( ) { long longVal = - 58930018L ; BigInteger aNumber = BigInteger . valueOf ( longVal ) ; byte rBytes [ ] = { - 4 , 124 , - 52 , - 98 } ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = aNumber . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( "incorrect sign" , - 1 , aNumber . signum ( ) ) ; }
valueof ( long val ) : convert a negative long value to a biginteger . the long value fits in integer .
