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/ojluni/src/main/java/java/math/
DBigDecimal.java2494 int newScale = checkScale((long)scale * n);
2495 return new BigDecimal(this.inflated().pow(n), newScale);
2881 public BigDecimal setScale(int newScale, RoundingMode roundingMode) {
2882 return setScale(newScale, roundingMode.oldMode);
2926 public BigDecimal setScale(int newScale, int roundingMode) {
2931 if (newScale == oldScale) // easy case
2934 return zeroValueOf(newScale);
2937 if (newScale > oldScale) {
2938 int raise = checkScale((long) newScale - oldScale);
2940 return valueOf(rs,newScale);
[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()