question: public void testMultiplyMathContextScalePosPos ( ) { String a = "97665696756578755423325476545428779810457634781384756794987" ; int aScale = - 25 ; String b = "87656965586786097685674786576598865" ; int bScale = 10 ; String c = "8.561078619600910561431314228543672720908E+108" ; int cScale = - 69 ; BigDecimal aNumber = new BigDecimal ( new BigInteger ( a ) , aScale ) ; BigDecimal bNumber = new BigDecimal ( new BigInteger ( b ) , bScale ) ; MathContext mc = new MathContext ( 40 , RoundingMode . HALF_DOWN ) ; BigDecimal result = aNumber . multiply ( bNumber , mc ) ; assertEquals ( "incorrect value" , c , result . toString ( ) ) ; assertEquals ( "incorrect scale" , cScale , result . scale ( ) ) ; }
target:  Multiply two numbers of positive scales using MathContext