public void testMultiplyEqualScaleNegNeg(){
  String a="1231212478987482988429808779810457634781384756794987";
  int aScale=-15;
  String b="747233429293018787918347987234564568";
  int bScale=-10;
  String c="9.20003122862175749786430095741145455670101391569026662845893091880727173060570190220616E+111";
  int cScale=-25;
  BigDecimal aNumber=new BigDecimal(new BigInteger(a),aScale);
  BigDecimal bNumber=new BigDecimal(new BigInteger(b),bScale);
  BigDecimal result=aNumber.multiply(bNumber);
  assertEquals("incorrect value",c,result.toString());
  assertEquals("incorrect scale",cScale,result.scale());
}

public void testMultiplyEqualScaleNegNeg ( ) { String a = "1231212478987482988429808779810457634781384756794987" ; int aScale = - 15 ; String b = "747233429293018787918347987234564568" ; int bScale = - 10 ; String c = "9.20003122862175749786430095741145455670101391569026662845893091880727173060570190220616E+111" ; int cScale = - 25 ; BigDecimal aNumber = new BigDecimal ( new BigInteger ( a ) , aScale ) ; BigDecimal bNumber = new BigDecimal ( new BigInteger ( b ) , bScale ) ; BigDecimal result = aNumber . multiply ( bNumber ) ; assertEquals ( "incorrect value" , c , result . toString ( ) ) ; assertEquals ( "incorrect scale" , cScale , result . scale ( ) ) ; }
multiply two numbers of negative scales
