question: public void testSubtractMathContextDiffScaleNegPos ( ) { String a = "986798656676789766678767876078779810457634781384756794987" ; int aScale = - 15 ; String b = "747233429293018787918347987234564568" ; int bScale = 40 ; String c = "9.867986566767897666787678760787798104576347813847567949870000000000000E+71" ; int cScale = - 2 ; BigDecimal aNumber = new BigDecimal ( new BigInteger ( a ) , aScale ) ; BigDecimal bNumber = new BigDecimal ( new BigInteger ( b ) , bScale ) ; MathContext mc = new MathContext ( 70 , RoundingMode . HALF_DOWN ) ; BigDecimal result = aNumber . subtract ( bNumber , mc ) ; assertEquals ( "incorrect value" , c , result . toString ( ) ) ; assertEquals ( "incorrect scale" , cScale , result . scale ( ) ) ; }
target:  Subtract two numbers of different scales using MathContext; the first is negative