public void testAbsMathContextNeg(){
  String a="-123809648392384754573567356745735.63567890295784902768787678287E+21";
  BigDecimal aNumber=new BigDecimal(a);
  int precision=15;
  RoundingMode rm=RoundingMode.HALF_DOWN;
  MathContext mc=new MathContext(precision,rm);
  String result="1.23809648392385E+53";
  int resScale=-39;
  BigDecimal res=aNumber.abs(mc);
  assertEquals("incorrect value",result,res.toString());
  assertEquals("incorrect scale",resScale,res.scale());
}

public void testAbsMathContextNeg ( ) { String a = "-123809648392384754573567356745735.63567890295784902768787678287E+21" ; BigDecimal aNumber = new BigDecimal ( a ) ; int precision = 15 ; RoundingMode rm = RoundingMode . HALF_DOWN ; MathContext mc = new MathContext ( precision , rm ) ; String result = "1.23809648392385E+53" ; int resScale = - 39 ; BigDecimal res = aNumber . abs ( mc ) ; assertEquals ( "incorrect value" , result , res . toString ( ) ) ; assertEquals ( "incorrect scale" , resScale , res . scale ( ) ) ; }
abs ( mathcontext ) of a negative bigdecimal
