question: public void testSubtractMathContextDiffScalePosNeg ( ) { String a = "1231212478987482988429808779810457634781384756794987" ; int aScale = 15 ; String b = "747233429293018787918347987234564568" ; int bScale = - 10 ; String c = "-7.4723342916989754E+45" ; int cScale = - 29 ; BigDecimal aNumber = new BigDecimal ( new BigInteger ( a ) , aScale ) ; BigDecimal bNumber = new BigDecimal ( new BigInteger ( b ) , bScale ) ; MathContext mc = new MathContext ( 17 , RoundingMode . 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 positive