Home
last modified time | relevance | path

Searched refs:RoundingMode (Results 1 – 25 of 106) sorted by relevance

12345

/external/icu/icu4j/main/classes/localespi/src/com/ibm/icu/impl/jdkadapter/
DNumberFormatICU.java11 import java.math.RoundingMode;
109 public RoundingMode getRoundingMode() { in getRoundingMode()
111 RoundingMode mode = RoundingMode.UP; in getRoundingMode()
114 mode = RoundingMode.CEILING; in getRoundingMode()
117 mode = RoundingMode.DOWN; in getRoundingMode()
120 mode = RoundingMode.FLOOR; in getRoundingMode()
123 mode = RoundingMode.HALF_DOWN; in getRoundingMode()
126 mode = RoundingMode.HALF_EVEN; in getRoundingMode()
129 mode = RoundingMode.HALF_UP; in getRoundingMode()
132 mode = RoundingMode.UNNECESSARY; in getRoundingMode()
[all …]
DDecimalFormatICU.java11 import java.math.RoundingMode;
198 public RoundingMode getRoundingMode() { in getRoundingMode()
200 RoundingMode mode = RoundingMode.UP; in getRoundingMode()
203 mode = RoundingMode.CEILING; in getRoundingMode()
206 mode = RoundingMode.DOWN; in getRoundingMode()
209 mode = RoundingMode.FLOOR; in getRoundingMode()
212 mode = RoundingMode.HALF_DOWN; in getRoundingMode()
215 mode = RoundingMode.HALF_EVEN; in getRoundingMode()
218 mode = RoundingMode.HALF_UP; in getRoundingMode()
221 mode = RoundingMode.UNNECESSARY; in getRoundingMode()
[all …]
/external/icu/icu4c/source/i18n/
Dnumber_roundingutils.h45 getRoundingDirection(bool isEven, bool isNegative, Section section, RoundingMode roundingMode, in getRoundingDirection()
48 case RoundingMode::UNUM_ROUND_UP: in getRoundingDirection()
52 case RoundingMode::UNUM_ROUND_DOWN: in getRoundingDirection()
56 case RoundingMode::UNUM_ROUND_CEILING: in getRoundingDirection()
60 case RoundingMode::UNUM_ROUND_FLOOR: in getRoundingDirection()
64 case RoundingMode::UNUM_ROUND_HALFUP: in getRoundingDirection()
77 case RoundingMode::UNUM_ROUND_HALFDOWN: in getRoundingDirection()
90 case RoundingMode::UNUM_ROUND_HALFEVEN: in getRoundingDirection()
123 case RoundingMode::UNUM_ROUND_UP: in roundsAtMidpoint()
124 case RoundingMode::UNUM_ROUND_DOWN: in roundsAtMidpoint()
[all …]
/external/icu/icu4j/main/classes/localespi/src/com/ibm/icu/impl/icuadapter/
DNumberFormatJDK.java11 import java.math.RoundingMode;
150 RoundingMode jdkMode = fJdkNfmt.getRoundingMode(); in getRoundingMode()
153 if (jdkMode.equals(RoundingMode.CEILING)) { in getRoundingMode()
155 } else if (jdkMode.equals(RoundingMode.DOWN)) { in getRoundingMode()
157 } else if (jdkMode.equals(RoundingMode.FLOOR)) { in getRoundingMode()
159 } else if (jdkMode.equals(RoundingMode.HALF_DOWN)) { in getRoundingMode()
161 } else if (jdkMode.equals(RoundingMode.HALF_EVEN)) { in getRoundingMode()
163 } else if (jdkMode.equals(RoundingMode.HALF_UP)) { in getRoundingMode()
165 } else if (jdkMode.equals(RoundingMode.UNNECESSARY)) { in getRoundingMode()
167 } else if (jdkMode.equals(RoundingMode.UP)) { in getRoundingMode()
[all …]
/external/icu/android_icu4j/src/main/java/android/icu/impl/number/
DRoundingUtils.java8 import java.math.RoundingMode;
23 public static final RoundingMode DEFAULT_ROUNDING_MODE = RoundingMode.HALF_EVEN;
141 …e static final MathContext[] MATH_CONTEXT_BY_ROUNDING_MODE_UNLIMITED = new MathContext[RoundingMode
144 …e static final MathContext[] MATH_CONTEXT_BY_ROUNDING_MODE_34_DIGITS = new MathContext[RoundingMode
149 … MATH_CONTEXT_BY_ROUNDING_MODE_UNLIMITED[i] = new MathContext(0, RoundingMode.valueOf(i));
174 RoundingMode roundingMode = properties.getRoundingMode(); in getMathContextOrUnlimited()
176 roundingMode = RoundingMode.HALF_EVEN; in getMathContextOrUnlimited()
194 RoundingMode roundingMode = properties.getRoundingMode(); in getMathContextOr34Digits()
196 roundingMode = RoundingMode.HALF_EVEN; in getMathContextOr34Digits()
210 public static MathContext mathContextUnlimited(RoundingMode roundingMode) { in mathContextUnlimited()
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/number/
DRoundingUtils.java7 import java.math.RoundingMode;
21 public static final RoundingMode DEFAULT_ROUNDING_MODE = RoundingMode.HALF_EVEN;
139 …e static final MathContext[] MATH_CONTEXT_BY_ROUNDING_MODE_UNLIMITED = new MathContext[RoundingMode
142 …e static final MathContext[] MATH_CONTEXT_BY_ROUNDING_MODE_34_DIGITS = new MathContext[RoundingMode
147 … MATH_CONTEXT_BY_ROUNDING_MODE_UNLIMITED[i] = new MathContext(0, RoundingMode.valueOf(i));
172 RoundingMode roundingMode = properties.getRoundingMode(); in getMathContextOrUnlimited()
174 roundingMode = RoundingMode.HALF_EVEN; in getMathContextOrUnlimited()
192 RoundingMode roundingMode = properties.getRoundingMode(); in getMathContextOr34Digits()
194 roundingMode = RoundingMode.HALF_EVEN; in getMathContextOr34Digits()
208 public static MathContext mathContextUnlimited(RoundingMode roundingMode) { in mathContextUnlimited()
/external/guava/guava-tests/test/com/google/common/math/
DBigIntegerMathTest.java27 import static java.math.RoundingMode.CEILING;
28 import static java.math.RoundingMode.DOWN;
29 import static java.math.RoundingMode.FLOOR;
30 import static java.math.RoundingMode.HALF_DOWN;
31 import static java.math.RoundingMode.HALF_EVEN;
32 import static java.math.RoundingMode.HALF_UP;
33 import static java.math.RoundingMode.UNNECESSARY;
34 import static java.math.RoundingMode.UP;
45 import java.math.RoundingMode;
70 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2ZeroAlwaysThrows()
[all …]
DDoubleMathTest.java29 import static java.math.RoundingMode.CEILING;
30 import static java.math.RoundingMode.DOWN;
31 import static java.math.RoundingMode.FLOOR;
32 import static java.math.RoundingMode.HALF_DOWN;
33 import static java.math.RoundingMode.HALF_EVEN;
34 import static java.math.RoundingMode.HALF_UP;
35 import static java.math.RoundingMode.UNNECESSARY;
36 import static java.math.RoundingMode.UP;
50 import java.math.RoundingMode;
85 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) { in testRoundIntegralDoubleToInt()
[all …]
DMathTesting.java21 import static java.math.RoundingMode.CEILING;
22 import static java.math.RoundingMode.DOWN;
23 import static java.math.RoundingMode.FLOOR;
24 import static java.math.RoundingMode.HALF_DOWN;
25 import static java.math.RoundingMode.HALF_EVEN;
26 import static java.math.RoundingMode.HALF_UP;
27 import static java.math.RoundingMode.UP;
39 import java.math.RoundingMode;
48 static final ImmutableSet<RoundingMode> ALL_ROUNDING_MODES = ImmutableSet.copyOf(RoundingMode
51 static final ImmutableList<RoundingMode> ALL_SAFE_ROUNDING_MODES = ImmutableList.of(DOWN, UP,
DIntMathTest.java28 import static java.math.RoundingMode.FLOOR;
29 import static java.math.RoundingMode.UNNECESSARY;
39 import java.math.RoundingMode;
122 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2ZeroAlwaysThrows()
132 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2NegativeAlwaysThrows()
144 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) { in testLog2MatchesBigInteger()
166 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog10ZeroAlwaysThrows()
177 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog10NegativeAlwaysThrows()
190 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) { in testLog10MatchesBigInteger()
215 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog10TrivialOnPowerOfTen()
[all …]
DLongMathTest.java30 import static java.math.RoundingMode.FLOOR;
31 import static java.math.RoundingMode.UNNECESSARY;
41 import java.math.RoundingMode;
175 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2ZeroAlwaysThrows()
185 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2NegativeAlwaysThrows()
197 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) { in testLog2MatchesBigInteger()
220 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog10ZeroAlwaysThrows()
231 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog10NegativeAlwaysThrows()
244 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) { in testLog10MatchesBigInteger()
268 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog10TrivialOnPowerOf10()
[all …]
/external/guava/guava-gwt/test-super/com/google/common/math/super/com/google/common/math/
DBigIntegerMathTest.java24 import static java.math.RoundingMode.CEILING;
25 import static java.math.RoundingMode.DOWN;
26 import static java.math.RoundingMode.FLOOR;
27 import static java.math.RoundingMode.HALF_DOWN;
28 import static java.math.RoundingMode.HALF_EVEN;
29 import static java.math.RoundingMode.HALF_UP;
30 import static java.math.RoundingMode.UNNECESSARY;
31 import static java.math.RoundingMode.UP;
39 import java.math.RoundingMode;
58 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2ZeroAlwaysThrows()
[all …]
DIntMathTest.java28 import static java.math.RoundingMode.UNNECESSARY;
36 import java.math.RoundingMode;
59 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2ZeroAlwaysThrows()
69 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2NegativeAlwaysThrows()
81 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) { in testLog2MatchesBigInteger()
114 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) { in testDivNonZero()
148 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testZeroDivIsAlwaysZero()
156 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testDivByZeroAlwaysFails()
DLongMathTest.java26 import static java.math.RoundingMode.UNNECESSARY;
34 import java.math.RoundingMode;
60 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2ZeroAlwaysThrows()
70 for (RoundingMode mode : ALL_ROUNDING_MODES) { in testLog2NegativeAlwaysThrows()
82 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) { in testLog2MatchesBigInteger()
/external/caliper/caliper/src/main/java/com/google/caliper/util/
DShortDuration.java30 import java.math.RoundingMode;
61 return ofPicos(toLong(picos, RoundingMode.HALF_UP)); in of()
107 return to(unit, RoundingMode.HALF_UP); in to()
110 public abstract long to(TimeUnit unit, RoundingMode roundingMode); in to()
142 public abstract ShortDuration times(BigDecimal multiplicand, RoundingMode roundingMode); in times()
151 public abstract ShortDuration dividedBy(long divisor, RoundingMode roundingMode); in dividedBy()
160 public abstract ShortDuration dividedBy(BigDecimal divisor, RoundingMode roundingMode); in dividedBy()
165 @Override public long to(TimeUnit unit, RoundingMode roundingMode) {
178 @Override public ShortDuration times(BigDecimal multiplicand, RoundingMode roundingMode) {
181 @Override public ShortDuration dividedBy(long divisor, RoundingMode roundingMode) {
[all …]
/external/icu/icu4c/source/test/intltest/
Dnumbertest_decimalquantity.cpp94 fq.roundToIncrement(0.005, RoundingMode::UNUM_ROUND_HALFEVEN, 3, status); in testDecimalQuantityBehaviorStandalone()
97 fq.roundToMagnitude(-2, RoundingMode::UNUM_ROUND_HALFEVEN, status); in testDecimalQuantityBehaviorStandalone()
116 fq.roundToMagnitude(5, RoundingMode::UNUM_ROUND_HALFEVEN, status); in testSwitchStorage()
285 RoundingMode roundingMode; in testUseApproximateDoubleWhenAble()
287 } cases[] = {{1.2345678, 1, RoundingMode::UNUM_ROUND_HALFEVEN, false}, in testUseApproximateDoubleWhenAble()
288 {1.2345678, 7, RoundingMode::UNUM_ROUND_HALFEVEN, false}, in testUseApproximateDoubleWhenAble()
289 {1.2345678, 12, RoundingMode::UNUM_ROUND_HALFEVEN, false}, in testUseApproximateDoubleWhenAble()
290 {1.2345678, 13, RoundingMode::UNUM_ROUND_HALFEVEN, true}, in testUseApproximateDoubleWhenAble()
291 {1.235, 1, RoundingMode::UNUM_ROUND_HALFEVEN, false}, in testUseApproximateDoubleWhenAble()
292 {1.235, 2, RoundingMode::UNUM_ROUND_HALFEVEN, true}, in testUseApproximateDoubleWhenAble()
[all …]
/external/swiftshader/third_party/LLVM/lib/Target/PTX/
DPTXInstrFormats.td12 /*class RoundingMode<bits<3> val> {
16 def RndDefault : RoundingMode<0>;
17 def RndNearestEven : RoundingMode<1>;
18 def RndNearestZero : RoundingMode<2>;
19 def RndNegInf : RoundingMode<3>;
20 def RndPosInf : RoundingMode<4>;
21 def RndApprox : RoundingMode<5>;*/
/external/swiftshader/third_party/llvm-7.0/llvm/lib/Target/RISCV/MCTargetDesc/
DRISCVBaseInfo.h68 enum RoundingMode { enum
78 inline static StringRef roundingModeToString(RoundingMode RndMode) { in roundingModeToString()
97 inline static RoundingMode stringToRoundingMode(StringRef Str) { in stringToRoundingMode()
98 return StringSwitch<RoundingMode>(Str) in stringToRoundingMode()
/external/guava/guava/src/com/google/common/math/
DBigIntegerMath.java24 import static java.math.RoundingMode.CEILING;
25 import static java.math.RoundingMode.FLOOR;
26 import static java.math.RoundingMode.HALF_EVEN;
34 import java.math.RoundingMode;
69 public static int log2(BigInteger x, RoundingMode mode) { in log2()
129 public static int log10(BigInteger x, RoundingMode mode) { in log10()
207 public static BigInteger sqrt(BigInteger x, RoundingMode mode) { in sqrt()
298 public static BigInteger divide(BigInteger p, BigInteger q, RoundingMode mode) { in divide()
416 int bits = LongMath.log2(n, RoundingMode.CEILING); in binomial()
DIntMath.java27 import static java.math.RoundingMode.HALF_EVEN;
28 import static java.math.RoundingMode.HALF_UP;
35 import java.math.RoundingMode;
87 public static int log2(int x, RoundingMode mode) { in log2()
128 public static int log10(int x, RoundingMode mode) { in log10()
231 public static int sqrt(int x, RoundingMode mode) { in sqrt()
278 public static int divide(int p, int q, RoundingMode mode) { in divide()
DLongMath.java27 import static java.math.RoundingMode.HALF_EVEN;
28 import static java.math.RoundingMode.HALF_UP;
35 import java.math.RoundingMode;
85 public static int log2(long x, RoundingMode mode) { in log2()
127 public static int log10(long x, RoundingMode mode) { in log10()
275 public static long sqrt(long x, RoundingMode mode) { in sqrt()
347 public static long divide(long p, long q, RoundingMode mode) { in divide()
674 int nBits = LongMath.log2(n, RoundingMode.CEILING);
/external/apache-commons-math/src/main/java/org/apache/commons/math/util/
DBigReal.java24 import java.math.RoundingMode;
53 private RoundingMode roundingMode = RoundingMode.HALF_UP;
197 public RoundingMode getRoundingMode() { in getRoundingMode()
206 public void setRoundingMode(RoundingMode roundingMode) { in setRoundingMode()
/external/guava/guava-gwt/src-super/com/google/common/math/super/com/google/common/math/
DBigIntegerMath.java24 import static java.math.RoundingMode.CEILING;
25 import static java.math.RoundingMode.FLOOR;
26 import static java.math.RoundingMode.HALF_EVEN;
32 import java.math.RoundingMode;
67 public static int log2(BigInteger x, RoundingMode mode) { in log2()
233 int bits = LongMath.log2(n, RoundingMode.CEILING); in binomial()
DLongMath.java24 import static java.math.RoundingMode.HALF_EVEN;
25 import static java.math.RoundingMode.HALF_UP;
30 import java.math.RoundingMode;
80 public static int log2(long x, RoundingMode mode) { in log2()
229 int nBits = LongMath.log2(n, RoundingMode.CEILING); in binomial()
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/
DNumberSkeletonTest.java9 import java.math.RoundingMode;
272 for (RoundingMode mode : RoundingMode.values()) { in roundingModeNames()
273 if (mode == RoundingMode.HALF_EVEN) { in roundingModeNames()

12345