public void testNegateMathContextPositive(){
  String a="92948782094488478231212478987482988429808779810457634781384756794987";
  int aScale=41;
  int precision=37;
  RoundingMode rm=RoundingMode.FLOOR;
  MathContext mc=new MathContext(precision,rm);
  String c="-929487820944884782312124789.8748298843";
  int cScale=10;
  BigDecimal aNumber=new BigDecimal(new BigInteger(a),aScale);
  BigDecimal res=aNumber.negate(mc);
  assertEquals("incorrect value",c,res.toString());
  assertEquals("incorrect scale",cScale,res.scale());
}

public void testNegateMathContextPositive ( ) { String a = "92948782094488478231212478987482988429808779810457634781384756794987" ; int aScale = 41 ; int precision = 37 ; RoundingMode rm = RoundingMode . FLOOR ; MathContext mc = new MathContext ( precision , rm ) ; String c = "-929487820944884782312124789.8748298843" ; int cScale = 10 ; BigDecimal aNumber = new BigDecimal ( new BigInteger ( a ) , aScale ) ; BigDecimal res = aNumber . negate ( mc ) ; assertEquals ( "incorrect value" , c , res . toString ( ) ) ; assertEquals ( "incorrect scale" , cScale , res . scale ( ) ) ; }
negate ( mathcontext ) for a positive bigdecimal
