Home
last modified time | relevance | path

Searched refs:quantity (Results 1 – 25 of 215) sorted by relevance

123456789

/external/icu/icu4c/source/i18n/
Dnumparse_parsednumber.cpp30 quantity.bogus = true; in clear()
43 if (!quantity.bogus && 0 != (flags & FLAG_NEGATIVE)) { in postProcess()
44 quantity.negate(); in postProcess()
53 return !quantity.bogus || 0 != (flags & FLAG_NAN) || 0 != (flags & FLAG_INFINITY); in seenNumber()
73 if (quantity.bogus) { in getDouble()
77 if (quantity.isZeroish() && quantity.isNegative()) { in getDouble()
81 if (quantity.fitsInLong()) { in getDouble()
82 return static_cast<double>(quantity.toLong()); in getDouble()
84 return quantity.toDouble(); in getDouble()
109 U_ASSERT(!quantity.bogus); in populateFormattable()
[all …]
Dunits_complexconverter.cpp102 UBool ComplexUnitsConverter::greaterThanOrEqual(double quantity, double limit) const { in greaterThanOrEqual() argument
106 double newQuantity = unitConverters_[0]->convert(quantity); in greaterThanOrEqual()
110 MaybeStackVector<Measure> ComplexUnitsConverter::convert(double quantity, in convert() argument
116 if (quantity < 0) { in convert()
117 quantity *= -1; in convert()
133 quantity = (*unitConverters_[i]).convert(quantity); in convert()
141 int64_t roundedQuantity = floor(quantity * (1 + DBL_EPSILON)); in convert()
149 if ((quantity - roundedQuantity) / quantity < DBL_EPSILON) { in convert()
150 quantity = 0; in convert()
152 quantity -= roundedQuantity; in convert()
[all …]
Dnumber_usageprefs.cpp109 void mixedMeasuresToMicros(const MaybeStackVector<Measure> &measures, DecimalQuantity *quantity, in mixedMeasuresToMicros() argument
141 quantity->setToDouble(measures[measures.length() - 1]->getNumber().getDouble()); in mixedMeasuresToMicros()
153 void UsagePrefsHandler::processQuantity(DecimalQuantity &quantity, MicroProps &micros, in processQuantity() argument
155 fParent->processQuantity(quantity, micros, status); in processQuantity()
160 quantity.roundToInfinity(); // Enables toDouble in processQuantity()
161 …const units::RouteResult routed = fUnitsRouter.route(quantity.toDouble(), &micros.rounder, status); in processQuantity()
171 mixedMeasuresToMicros(routedMeasures, &quantity, &micros, status); in processQuantity()
192 void UnitConversionHandler::processQuantity(DecimalQuantity &quantity, MicroProps &micros, in processQuantity() argument
194 fParent->processQuantity(quantity, micros, status); in processQuantity()
198 quantity.roundToInfinity(); // Enables toDouble in processQuantity()
[all …]
Dnumber_scientific.cpp121 void ScientificHandler::processQuantity(DecimalQuantity &quantity, MicroProps &micros, in processQuantity() argument
123 fParent->processQuantity(quantity, micros, status); in processQuantity()
127 if (quantity.isInfinite() || quantity.isNaN()) { in processQuantity()
134 if (quantity.isZeroish()) { in processQuantity()
137 micros.rounder.apply(quantity, fSettings.fEngineeringInterval, status); in processQuantity()
140 micros.rounder.apply(quantity, status); in processQuantity()
144 exponent = -micros.rounder.chooseMultiplierAndApply(quantity, *this, status); in processQuantity()
155 quantity.adjustExponent(exponent); in processQuantity()
Dnumber_multiplier.cpp131 void Scale::applyTo(impl::DecimalQuantity& quantity) const { in applyTo()
132 quantity.adjustMagnitude(fMagnitude); in applyTo()
135 quantity.multiplyBy(*fArbitrary, localStatus); in applyTo()
139 void Scale::applyReciprocalTo(impl::DecimalQuantity& quantity) const { in applyReciprocalTo()
140 quantity.adjustMagnitude(-fMagnitude); in applyReciprocalTo()
143 quantity.divideBy(*fArbitrary, localStatus); in applyReciprocalTo()
154 void MultiplierFormatHandler::processQuantity(DecimalQuantity& quantity, MicroProps& micros, in processQuantity() argument
156 fParent->processQuantity(quantity, micros, status); in processQuantity()
157 fMultiplier.applyTo(quantity); in processQuantity()
Dnumber_integerwidth.cpp42 void IntegerWidth::apply(impl::DecimalQuantity& quantity, UErrorCode& status) const { in apply() argument
49 quantity.setMinInteger(fUnion.minMaxInt.fMinInt); in apply()
53 fUnion.minMaxInt.fMaxInt < quantity.getMagnitude()) { in apply()
56 quantity.setMinInteger(fUnion.minMaxInt.fMinInt); in apply()
57 quantity.applyMaxInteger(fUnion.minMaxInt.fMaxInt); in apply()
/external/icu/android_icu4j/src/main/java/android/icu/impl/number/parse/
DParsedNumber.java22 public DecimalQuantity_DualStorageBCD quantity; field in ParsedNumber
78 quantity = null; in clear()
87 quantity = other.quantity == null ? null in copyFrom()
88 : (DecimalQuantity_DualStorageBCD) other.quantity.createCopy(); in copyFrom()
118 if (quantity != null && 0 != (flags & FLAG_NEGATIVE)) { in postProcess()
119 quantity.negate(); in postProcess()
132 return quantity != null || 0 != (flags & FLAG_NAN) || 0 != (flags & FLAG_INFINITY); in seenNumber()
157 assert quantity != null; in getNumber()
158 if (quantity.isZeroish() && quantity.isNegative() && !integerOnly) { in getNumber()
162 if (quantity.fitsInLong() && !forceBigDecimal) { in getNumber()
[all …]
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/
DParsedNumber.java20 public DecimalQuantity_DualStorageBCD quantity; field in ParsedNumber
76 quantity = null; in clear()
85 quantity = other.quantity == null ? null in copyFrom()
86 : (DecimalQuantity_DualStorageBCD) other.quantity.createCopy(); in copyFrom()
116 if (quantity != null && 0 != (flags & FLAG_NEGATIVE)) { in postProcess()
117 quantity.negate(); in postProcess()
130 return quantity != null || 0 != (flags & FLAG_NAN) || 0 != (flags & FLAG_INFINITY); in seenNumber()
155 assert quantity != null; in getNumber()
156 if (quantity.isZeroish() && quantity.isNegative() && !integerOnly) { in getNumber()
160 if (quantity.fitsInLong() && !forceBigDecimal) { in getNumber()
[all …]
/external/icu/android_icu4j/src/main/java/android/icu/impl/units/
DComplexUnitsConverter.java93 public boolean greaterThanOrEqual(BigDecimal quantity, BigDecimal limit) { in greaterThanOrEqual() argument
97 …return unitConverters_.get(0).convert(quantity).multiply(EPSILON_MULTIPLIER).compareTo(limit) >= 0; in greaterThanOrEqual()
108 public List<Measure> convert(BigDecimal quantity, Precision rounder) { in convert() argument
111 if (quantity.compareTo(BigDecimal.ZERO) < 0) { in convert()
112 quantity = quantity.abs(); in convert()
125 quantity = (unitConverters_.get(i)).convert(quantity); in convert()
135 quantity.multiply(EPSILON_MULTIPLIER).setScale(0, RoundingMode.FLOOR); in convert()
140 quantity = quantity.subtract(roundedQuantity); in convert()
141 if (quantity.compareTo(BigDecimal.ZERO) == -1) { in convert()
142 quantity = BigDecimal.ZERO; in convert()
[all …]
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/units/
DComplexUnitsConverter.java91 public boolean greaterThanOrEqual(BigDecimal quantity, BigDecimal limit) { in greaterThanOrEqual() argument
95 …return unitConverters_.get(0).convert(quantity).multiply(EPSILON_MULTIPLIER).compareTo(limit) >= 0; in greaterThanOrEqual()
106 public List<Measure> convert(BigDecimal quantity, Precision rounder) { in convert() argument
109 if (quantity.compareTo(BigDecimal.ZERO) < 0) { in convert()
110 quantity = quantity.abs(); in convert()
123 quantity = (unitConverters_.get(i)).convert(quantity); in convert()
133 quantity.multiply(EPSILON_MULTIPLIER).setScale(0, RoundingMode.FLOOR); in convert()
138 quantity = quantity.subtract(roundedQuantity); in convert()
139 if (quantity.compareTo(BigDecimal.ZERO) == -1) { in convert()
140 quantity = BigDecimal.ZERO; in convert()
[all …]
/external/robolectric-shadows/resources/src/main/java/org/robolectric/res/
DPlural.java4 final String quantity, string; field in Plural
8 Plural(String quantity, String string) { in Plural() argument
9 this.quantity = quantity; in Plural()
11 if ("zero".equals(quantity)) { in Plural()
14 } else if ("one".equals(quantity)) { in Plural()
17 } else if ("two".equals(quantity)) { in Plural()
20 } else if ("other".equals(quantity)) { in Plural()
35 return quantity + "(" + num + "): " + string; in toString()
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/number/
DCompactNotation.java125 public MicroProps processQuantity(DecimalQuantity quantity) { in processQuantity() argument
126 MicroProps micros = parent.processQuantity(quantity); in processQuantity()
132 if (quantity.isZeroish()) { in processQuantity()
134 micros.rounder.apply(quantity); in processQuantity()
136 multiplier = micros.rounder.chooseMultiplierAndApply(quantity, data); in processQuantity()
137 magnitude = quantity.isZeroish() ? 0 : quantity.getMagnitude(); in processQuantity()
141 StandardPlural plural = quantity.getStandardPlural(rules); in processQuantity()
150 mod.applyToMicros(micros, quantity); in processQuantity()
156 unsafePatternModifier.setNumberProperties(quantity.signum(), null); in processQuantity()
163 quantity.adjustExponent(-1 * multiplier); in processQuantity()
DScale.java178 public void applyTo(DecimalQuantity quantity) { in applyTo() argument
179 quantity.adjustMagnitude(magnitude); in applyTo()
181 quantity.multiplyBy(arbitrary); in applyTo()
190 public void applyReciprocalTo(DecimalQuantity quantity) { in applyReciprocalTo() argument
191 quantity.adjustMagnitude(-magnitude); in applyReciprocalTo()
193 quantity.multiplyBy(reciprocal); in applyReciprocalTo()
194 quantity.roundToMagnitude(quantity.getMagnitude() - mc.getPrecision(), mc); in applyReciprocalTo()
DScientificNotation.java156 public MicroProps processQuantity(DecimalQuantity quantity) { in processQuantity() argument
157 MicroProps micros = parent.processQuantity(quantity); in processQuantity()
161 if (quantity.isInfinite() || quantity.isNaN()) { in processQuantity()
168 if (quantity.isZeroish()) { in processQuantity()
171 ((SignificantRounderImpl) micros.rounder).apply(quantity, in processQuantity()
175 micros.rounder.apply(quantity); in processQuantity()
179 exponent = -micros.rounder.chooseMultiplierAndApply(quantity, this); in processQuantity()
198 quantity.adjustExponent(exponent); in processQuantity()
/external/icu/android_icu4j/src/main/java/android/icu/number/
DCompactNotation.java125 public MicroProps processQuantity(DecimalQuantity quantity) { in processQuantity() argument
126 MicroProps micros = parent.processQuantity(quantity); in processQuantity()
132 if (quantity.isZeroish()) { in processQuantity()
134 micros.rounder.apply(quantity); in processQuantity()
136 multiplier = micros.rounder.chooseMultiplierAndApply(quantity, data); in processQuantity()
137 magnitude = quantity.isZeroish() ? 0 : quantity.getMagnitude(); in processQuantity()
141 StandardPlural plural = quantity.getStandardPlural(rules); in processQuantity()
150 mod.applyToMicros(micros, quantity); in processQuantity()
156 unsafePatternModifier.setNumberProperties(quantity.signum(), null); in processQuantity()
163 quantity.adjustExponent(-1 * multiplier); in processQuantity()
DScale.java173 public void applyTo(DecimalQuantity quantity) { in applyTo() argument
174 quantity.adjustMagnitude(magnitude); in applyTo()
176 quantity.multiplyBy(arbitrary); in applyTo()
185 public void applyReciprocalTo(DecimalQuantity quantity) { in applyReciprocalTo() argument
186 quantity.adjustMagnitude(-magnitude); in applyReciprocalTo()
188 quantity.multiplyBy(reciprocal); in applyReciprocalTo()
189 quantity.roundToMagnitude(quantity.getMagnitude() - mc.getPrecision(), mc); in applyReciprocalTo()
DScientificNotation.java154 public MicroProps processQuantity(DecimalQuantity quantity) { in processQuantity() argument
155 MicroProps micros = parent.processQuantity(quantity); in processQuantity()
159 if (quantity.isInfinite() || quantity.isNaN()) { in processQuantity()
166 if (quantity.isZeroish()) { in processQuantity()
169 ((SignificantRounderImpl) micros.rounder).apply(quantity, in processQuantity()
173 micros.rounder.apply(quantity); in processQuantity()
177 exponent = -micros.rounder.chooseMultiplierAndApply(quantity, this); in processQuantity()
196 quantity.adjustExponent(exponent); in processQuantity()
/external/icu/android_icu4j/src/main/java/android/icu/impl/number/
DMixedUnitLongNameHandler.java103 public MicroProps processQuantity(DecimalQuantity quantity) { in processQuantity() argument
106 micros = parent.processQuantity(quantity); in processQuantity()
107 micros.modOuter = getMixedUnitModifier(quantity, micros); in processQuantity()
119 public MicroProps processQuantityWithMicros(DecimalQuantity quantity, MicroProps micros) { in processQuantityWithMicros() argument
121 micros.modOuter = getMixedUnitModifier(quantity, micros); in processQuantityWithMicros()
145 private Modifier getMixedUnitModifier(DecimalQuantity quantity, MicroProps micros) { in getMixedUnitModifier() argument
194 if (quantity.isNegative()) { in getMixedUnitModifier()
195 quantity.negate(); in getMixedUnitModifier()
199 StandardPlural finalPlural = RoundingUtils.getPluralSafe(micros.rounder, rules, quantity); in getMixedUnitModifier()
DUnitConversionHandler.java49 public MicroProps processQuantity(DecimalQuantity quantity) { in processQuantity() argument
50 MicroProps result = this.fParent.processQuantity(quantity); in processQuantity()
52 quantity.roundToInfinity(); // Enables toDouble in processQuantity()
53 …List<Measure> measures = this.fComplexUnitConverter.convert(quantity.toBigDecimal(), result.rounde… in processQuantity()
56 UsagePrefsHandler.mixedMeasuresToMicros(measures, quantity, result); in processQuantity()
/external/icu/android_icu4j/src/main/tests/android/icu/dev/test/number/
DDecimalQuantityTest.java438 DecimalQuantity_DualStorageBCD quantity = new DecimalQuantity_DualStorageBCD(); in testFitsInLong() local
439 quantity.setToInt(0); in testFitsInLong()
440 assertTrue("Zero should fit", quantity.fitsInLong()); in testFitsInLong()
441 quantity.setToInt(42); in testFitsInLong()
442 assertTrue("Small int should fit", quantity.fitsInLong()); in testFitsInLong()
443 quantity.setToDouble(0.1); in testFitsInLong()
444 assertFalse("Fraction should not fit", quantity.fitsInLong()); in testFitsInLong()
445 quantity.setToDouble(42.1); in testFitsInLong()
446 assertFalse("Fraction should not fit", quantity.fitsInLong()); in testFitsInLong()
447 quantity.setToLong(1000000); in testFitsInLong()
[all …]
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/number/
DMixedUnitLongNameHandler.java101 public MicroProps processQuantity(DecimalQuantity quantity) { in processQuantity() argument
104 micros = parent.processQuantity(quantity); in processQuantity()
105 micros.modOuter = getMixedUnitModifier(quantity, micros); in processQuantity()
117 public MicroProps processQuantityWithMicros(DecimalQuantity quantity, MicroProps micros) { in processQuantityWithMicros() argument
119 micros.modOuter = getMixedUnitModifier(quantity, micros); in processQuantityWithMicros()
143 private Modifier getMixedUnitModifier(DecimalQuantity quantity, MicroProps micros) { in getMixedUnitModifier() argument
192 if (quantity.isNegative()) { in getMixedUnitModifier()
193 quantity.negate(); in getMixedUnitModifier()
197 StandardPlural finalPlural = RoundingUtils.getPluralSafe(micros.rounder, rules, quantity); in getMixedUnitModifier()
DUnitConversionHandler.java47 public MicroProps processQuantity(DecimalQuantity quantity) { in processQuantity() argument
48 MicroProps result = this.fParent.processQuantity(quantity); in processQuantity()
50 quantity.roundToInfinity(); // Enables toDouble in processQuantity()
51 …List<Measure> measures = this.fComplexUnitConverter.convert(quantity.toBigDecimal(), result.rounde… in processQuantity()
54 UsagePrefsHandler.mixedMeasuresToMicros(measures, quantity, result); in processQuantity()
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/
DDecimalQuantityTest.java435 DecimalQuantity_DualStorageBCD quantity = new DecimalQuantity_DualStorageBCD(); in testFitsInLong() local
436 quantity.setToInt(0); in testFitsInLong()
437 assertTrue("Zero should fit", quantity.fitsInLong()); in testFitsInLong()
438 quantity.setToInt(42); in testFitsInLong()
439 assertTrue("Small int should fit", quantity.fitsInLong()); in testFitsInLong()
440 quantity.setToDouble(0.1); in testFitsInLong()
441 assertFalse("Fraction should not fit", quantity.fitsInLong()); in testFitsInLong()
442 quantity.setToDouble(42.1); in testFitsInLong()
443 assertFalse("Fraction should not fit", quantity.fitsInLong()); in testFitsInLong()
444 quantity.setToLong(1000000); in testFitsInLong()
[all …]
/external/cldr/tools/java/org/unicode/cldr/util/
DUnitPreferences.java68 …public void add(String quantity, String usage, String regions, String geq, String skeleton, String… in add() argument
70 …<Set<String>, UnitPreference>> usageToRegionsToInfo = quantityToUsageToRegionsToInfo.get(quantity); in add()
72 quantityToUsageToRegionsToInfo.put(quantity, usageToRegionsToInfo = new TreeMap<>()); in add()
121 String quantity = entry1.getKey(); in toString() local
127 …buffer.append("\n" + up.unit + "\t;\t" + getPath(order++, quantity, usage, regions, up.geq, up.ske… in toString()
135 …public String getPath(int order, String quantity, String usage, Collection<String> regions, Ration… in getPath() argument
139 + "[@category=\"" + quantity + "\"]" in getPath()
156 String quantity = entry1.getKey(); in getFastMap() local
158 result.put(quantity, result2); in getFastMap()
168 quantity = converter.getQuantityFromUnit(unit, false); in getFastMap()
[all …]
/external/robolectric-shadows/shadows/framework/src/main/java/org/robolectric/shadows/
DShadowNativePluralRules.java14 protected static int quantityForIntImpl(long address, int quantity) { in quantityForIntImpl() argument
16 if (quantity == 1) return 1; in quantityForIntImpl()
21 protected static int quantityForIntImpl(int address, int quantity) { in quantityForIntImpl() argument
22 return quantityForIntImpl((long)address, quantity); in quantityForIntImpl()

123456789