Home
last modified time | relevance | path

Searched refs:newScale (Results 1 – 4 of 4) sorted by relevance

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigDecimalScaleOperationsTest.java91 int newScale = 28; in testSetScaleGreater() local
93 BigDecimal bNumber = aNumber.setScale(newScale); in testSetScaleGreater()
94 assertTrue("incorrect scale", bNumber.scale() == newScale); in testSetScaleGreater()
103 int newScale = 5; in testSetScaleLess() local
105 BigDecimal bNumber = aNumber.setScale(newScale); in testSetScaleLess()
106 assertTrue("incorrect scale", bNumber.scale() == newScale); in testSetScaleLess()
116 int newScale = 18; in testSetScaleException() local
119 aNumber.setScale(newScale); in testSetScaleException()
132 int newScale = 18; in testSetScaleSame() local
134 BigDecimal bNumber = aNumber.setScale(newScale); in testSetScaleSame()
[all …]
DBigDecimalArithmeticTest.java1030 int newScale = 31; in testDivideBigDecimalScaleRoundingModeUP() local
1035 BigDecimal result = aNumber.divide(bNumber, newScale, rm); in testDivideBigDecimalScaleRoundingModeUP()
1037 assertEquals("incorrect scale", newScale, result.scale()); in testDivideBigDecimalScaleRoundingModeUP()
1048 int newScale = 31; in testDivideBigDecimalScaleRoundingModeDOWN() local
1053 BigDecimal result = aNumber.divide(bNumber, newScale, rm); in testDivideBigDecimalScaleRoundingModeDOWN()
1055 assertEquals("incorrect scale", newScale, result.scale()); in testDivideBigDecimalScaleRoundingModeDOWN()
1066 int newScale = 45; in testDivideBigDecimalScaleRoundingModeCEILING() local
1071 BigDecimal result = aNumber.divide(bNumber, newScale, rm); in testDivideBigDecimalScaleRoundingModeCEILING()
1073 assertEquals("incorrect scale", newScale, result.scale()); in testDivideBigDecimalScaleRoundingModeCEILING()
1084 int newScale = 45; in testDivideBigDecimalScaleRoundingModeFLOOR() local
[all …]
/libcore/luni/src/main/java/java/math/
DBigDecimal.java270 long newScale; // the new scale in BigDecimal() local
336 newScale = (long)scale - Integer.parseInt(scaleString); in BigDecimal()
337 scale = (int)newScale; in BigDecimal()
338 if (newScale != scale) { in BigDecimal()
933 long newScale = (long)this.scale + multiplicand.scale; in multiply() local
936 return zeroScaledBy(newScale); in multiply()
946 return valueOf(unscaledValue, safeLongToInt(newScale)); in multiply()
950 multiplicand.getUnscaledValue()), safeLongToInt(newScale)); in multiply()
1208 int newScale; // the new scale for final quotient in divide() local
1252 newScale = safeLongToInt(diffScale + Math.max(k, l)); in divide()
[all …]
/libcore/luni/src/test/java/libcore/java/math/
DOldBigDecimalArithmeticTest.java620 int newScale = 7; in test_DivideBigDecimalRoundingModeHALF_DOWN() local
625 BigDecimal result = aNumber.divide(bNumber, newScale, rm); in test_DivideBigDecimalRoundingModeHALF_DOWN()
627 assertEquals("incorrect scale", newScale, result.scale()); in test_DivideBigDecimalRoundingModeHALF_DOWN()