Home
last modified time | relevance | path

Searched refs:mathContext (Results 1 – 17 of 17) sorted by relevance

/external/icu/icu4j/main/classes/core/src/com/ibm/icu/number/
DPrecision.java26 /* package-private final */ MathContext mathContext; field in Precision
29 mathContext = RoundingUtils.DEFAULT_MATH_CONTEXT_UNLIMITED; in Precision()
345 public Precision withMode(MathContext mathContext) { in withMode() argument
346 if (this.mathContext.equals(mathContext)) { in withMode()
350 other.mathContext = mathContext; in withMode()
430 return returnValue.withMode(base.mathContext); in constructFractionSignificant()
477 return returnValue.withMode(base.mathContext); in constructFromCurrency()
585 copy.mathContext = mathContext; in createCopy()
598 copy.mathContext = mathContext; in into()
617 copy.mathContext = mathContext; in createCopy()
[all …]
DNumberPropertyMapper.java138 MathContext mathContext = RoundingUtils.getMathContextOrUnlimited(properties); in oldToNew() local
194 rounding = rounding.withMode(mathContext); in oldToNew()
270 macros.precision = Precision.constructInfinite().withMode(mathContext); in oldToNew()
273 … macros.precision = Precision.constructSignificant(1, maxFrac_ + 1).withMode(mathContext); in oldToNew()
284 .withMode(mathContext); in oldToNew()
318 exportedProperties.setMathContext(mathContext); in oldToNew()
319 exportedProperties.setRoundingMode(mathContext.getRoundingMode()); in oldToNew()
/external/icu/android_icu4j/src/main/java/android/icu/number/
DPrecision.java26 /* package-private final */ MathContext mathContext; field in Precision
29 mathContext = RoundingUtils.DEFAULT_MATH_CONTEXT_UNLIMITED; in Precision()
333 public Precision withMode(MathContext mathContext) { in withMode() argument
334 if (this.mathContext.equals(mathContext)) { in withMode()
338 other.mathContext = mathContext; in withMode()
418 return returnValue.withMode(base.mathContext); in constructFractionSignificant()
465 return returnValue.withMode(base.mathContext); in constructFromCurrency()
574 copy.mathContext = mathContext; in createCopy()
587 copy.mathContext = mathContext; in into()
606 copy.mathContext = mathContext; in createCopy()
[all …]
DNumberPropertyMapper.java139 MathContext mathContext = RoundingUtils.getMathContextOrUnlimited(properties); in oldToNew() local
195 rounding = rounding.withMode(mathContext); in oldToNew()
271 macros.precision = Precision.constructInfinite().withMode(mathContext); in oldToNew()
274 … macros.precision = Precision.constructSignificant(1, maxFrac_ + 1).withMode(mathContext); in oldToNew()
285 .withMode(mathContext); in oldToNew()
319 exportedProperties.setMathContext(mathContext); in oldToNew()
320 exportedProperties.setRoundingMode(mathContext.getRoundingMode()); in oldToNew()
/external/icu/android_icu4j/src/main/java/android/icu/impl/number/
DRoundingUtils.java175 MathContext mathContext = properties.getMathContext(); in getMathContextOrUnlimited() local
176 if (mathContext == null) { in getMathContextOrUnlimited()
180 mathContext = MATH_CONTEXT_BY_ROUNDING_MODE_UNLIMITED[roundingMode.ordinal()]; in getMathContextOrUnlimited()
182 return mathContext; in getMathContextOrUnlimited()
195 MathContext mathContext = properties.getMathContext(); in getMathContextOr34Digits() local
196 if (mathContext == null) { in getMathContextOr34Digits()
200 mathContext = MATH_CONTEXT_BY_ROUNDING_MODE_34_DIGITS[roundingMode.ordinal()]; in getMathContextOr34Digits()
202 return mathContext; in getMathContextOr34Digits()
DDecimalQuantity.java70 public void roundToIncrement(BigDecimal roundingInterval, MathContext mathContext); in roundToIncrement() argument
81 public void roundToNickel(int magnitude, MathContext mathContext); in roundToNickel() argument
92 public void roundToMagnitude(int roundingMagnitude, MathContext mathContext); in roundToMagnitude() argument
DDecimalQuantity_AbstractBCD.java175 public void roundToIncrement(BigDecimal roundingIncrement, MathContext mathContext) { in roundToIncrement() argument
184 temp = temp.divide(roundingIncrement, 0, mathContext.getRoundingMode()) in roundToIncrement()
186 .round(mathContext); in roundToIncrement()
751 public void roundToNickel(int magnitude, MathContext mathContext) { in roundToNickel() argument
752 roundToMagnitude(magnitude, mathContext, true); in roundToNickel()
756 public void roundToMagnitude(int magnitude, MathContext mathContext) { in roundToMagnitude() argument
757 roundToMagnitude(magnitude, mathContext, false); in roundToMagnitude()
760 private void roundToMagnitude(int magnitude, MathContext mathContext, boolean nickel) { in roundToMagnitude() argument
766 int _mcPrecision = mathContext.getPrecision(); in roundToMagnitude()
880 .roundsAtMidpoint(mathContext.getRoundingMode().ordinal()); in roundToMagnitude()
[all …]
DDecimalFormatProperties.java104 private transient MathContext mathContext; // ICU4J-only field in DecimalFormatProperties
176 mathContext = null; in _clear()
222 mathContext = other.mathContext; in _copyFrom()
269 eq = eq && _equalsHelper(mathContext, other.mathContext); in _equals()
332 hashCode ^= _hashCodeHelper(mathContext); in _hashCode()
468 return mathContext; in getMathContext()
850 public DecimalFormatProperties setMathContext(MathContext mathContext) { in setMathContext() argument
851 this.mathContext = mathContext; in setMathContext()
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/number/
DRoundingUtils.java173 MathContext mathContext = properties.getMathContext(); in getMathContextOrUnlimited() local
174 if (mathContext == null) { in getMathContextOrUnlimited()
178 mathContext = MATH_CONTEXT_BY_ROUNDING_MODE_UNLIMITED[roundingMode.ordinal()]; in getMathContextOrUnlimited()
180 return mathContext; in getMathContextOrUnlimited()
193 MathContext mathContext = properties.getMathContext(); in getMathContextOr34Digits() local
194 if (mathContext == null) { in getMathContextOr34Digits()
198 mathContext = MATH_CONTEXT_BY_ROUNDING_MODE_34_DIGITS[roundingMode.ordinal()]; in getMathContextOr34Digits()
200 return mathContext; in getMathContextOr34Digits()
DDecimalQuantity.java68 public void roundToIncrement(BigDecimal roundingInterval, MathContext mathContext); in roundToIncrement() argument
79 public void roundToNickel(int magnitude, MathContext mathContext); in roundToNickel() argument
90 public void roundToMagnitude(int roundingMagnitude, MathContext mathContext); in roundToMagnitude() argument
DDecimalQuantity_AbstractBCD.java173 public void roundToIncrement(BigDecimal roundingIncrement, MathContext mathContext) { in roundToIncrement() argument
182 temp = temp.divide(roundingIncrement, 0, mathContext.getRoundingMode()) in roundToIncrement()
184 .round(mathContext); in roundToIncrement()
749 public void roundToNickel(int magnitude, MathContext mathContext) { in roundToNickel() argument
750 roundToMagnitude(magnitude, mathContext, true); in roundToNickel()
754 public void roundToMagnitude(int magnitude, MathContext mathContext) { in roundToMagnitude() argument
755 roundToMagnitude(magnitude, mathContext, false); in roundToMagnitude()
758 private void roundToMagnitude(int magnitude, MathContext mathContext, boolean nickel) { in roundToMagnitude() argument
764 int _mcPrecision = mathContext.getPrecision(); in roundToMagnitude()
878 .roundsAtMidpoint(mathContext.getRoundingMode().ordinal()); in roundToMagnitude()
[all …]
DDecimalFormatProperties.java99 private transient MathContext mathContext; // ICU4J-only field in DecimalFormatProperties
171 mathContext = null; in _clear()
217 mathContext = other.mathContext; in _copyFrom()
264 eq = eq && _equalsHelper(mathContext, other.mathContext); in _equals()
327 hashCode ^= _hashCodeHelper(mathContext); in _hashCode()
463 return mathContext; in getMathContext()
845 public DecimalFormatProperties setMathContext(MathContext mathContext) { in setMathContext() argument
846 this.mathContext = mathContext; in setMathContext()
/external/icu/android_icu4j/src/main/tests/android/icu/dev/impl/number/
DDecimalQuantity_SimpleStorage.java368 public void roundToIncrement(BigDecimal roundingInterval, MathContext mathContext) {
372 d = d.divide(roundingInterval, 0, mathContext.getRoundingMode()).multiply(roundingInterval);
379 public void roundToNickel(int roundingMagnitude, MathContext mathContext) {
381 roundToIncrement(nickel, mathContext);
385 public void roundToMagnitude(int roundingMagnitude, MathContext mathContext) {
392 fallback = fallback.setScale(-roundingMagnitude, mathContext.getRoundingMode());
395 fallback = fallback.round(mathContext);
412 temp = temp.setScale(-roundingMagnitude, mathContext.getRoundingMode());
423 primary = new BigDecimal(primary).round(mathContext).longValueExact();
465 private void divideBy(BigDecimal divisor, int scale, MathContext mathContext) {
[all …]
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/impl/number/
DDecimalQuantity_SimpleStorage.java365 public void roundToIncrement(BigDecimal roundingInterval, MathContext mathContext) {
369 d = d.divide(roundingInterval, 0, mathContext.getRoundingMode()).multiply(roundingInterval);
376 public void roundToNickel(int roundingMagnitude, MathContext mathContext) {
378 roundToIncrement(nickel, mathContext);
382 public void roundToMagnitude(int roundingMagnitude, MathContext mathContext) {
389 fallback = fallback.setScale(-roundingMagnitude, mathContext.getRoundingMode());
392 fallback = fallback.round(mathContext);
409 temp = temp.setScale(-roundingMagnitude, mathContext.getRoundingMode());
420 primary = new BigDecimal(primary).round(mathContext).longValueExact();
462 private void divideBy(BigDecimal divisor, int scale, MathContext mathContext) {
[all …]
/external/icu/android_icu4j/src/main/java/android/icu/text/
DDecimalFormat.java1234 java.math.MathContext mathContext = exportedProperties.getMathContext(); in getMathContext() local
1235 assert mathContext != null; in getMathContext()
1236 return mathContext; in getMathContext()
1256 public synchronized void setMathContext(java.math.MathContext mathContext) { in setMathContext() argument
1257 properties.setMathContext(mathContext); in setMathContext()
1271 java.math.MathContext mathContext = getMathContext(); in getMathContextICU() local
1273 mathContext.getPrecision(), in getMathContextICU()
1276 mathContext.getRoundingMode().ordinal()); in getMathContextICU()
1290 java.math.MathContext mathContext; in setMathContextICU() local
1295 mathContext = new java.math.MathContext(mathContextICU.getDigits(), RoundingMode.UNNECESSARY); in setMathContextICU()
[all …]
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/text/
DDecimalFormat.java1305 java.math.MathContext mathContext = exportedProperties.getMathContext(); in getMathContext() local
1306 assert mathContext != null; in getMathContext()
1307 return mathContext; in getMathContext()
1329 public synchronized void setMathContext(java.math.MathContext mathContext) { in setMathContext() argument
1330 properties.setMathContext(mathContext); in setMathContext()
1346 java.math.MathContext mathContext = getMathContext(); in getMathContextICU() local
1348 mathContext.getPrecision(), in getMathContextICU()
1351 mathContext.getRoundingMode().ordinal()); in getMathContextICU()
1367 java.math.MathContext mathContext; in setMathContextICU() local
1372 mathContext = new java.math.MathContext(mathContextICU.getDigits(), RoundingMode.UNNECESSARY); in setMathContextICU()
[all …]
/external/cldr/tools/java/org/unicode/cldr/util/
DRational.java258 public BigDecimal toBigDecimal(MathContext mathContext) { in toBigDecimal() argument
260 return new BigDecimal(numerator).divide(new BigDecimal(denominator), mathContext); in toBigDecimal()
262 … throw new IllegalArgumentException("Wrong math context for divide: " + this + ", " + mathContext); in toBigDecimal()