Home
last modified time | relevance | path

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

1234

/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/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/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/icu4j/main/classes/core/src/com/ibm/icu/impl/number/
DRoundingUtils.java7 import java.math.RoundingMode;
19 public static final RoundingMode DEFAULT_ROUNDING_MODE = RoundingMode.HALF_EVEN;
127 new MathContext[RoundingMode.values().length];
130 new MathContext[RoundingMode.values().length];
134 MATH_CONTEXT_BY_ROUNDING_MODE_UNLIMITED[i] = new MathContext(0, RoundingMode.valueOf(i));
150 RoundingMode roundingMode = properties.getRoundingMode(); in getMathContextOrUnlimited()
151 if (roundingMode == null) roundingMode = RoundingMode.HALF_EVEN; in getMathContextOrUnlimited()
168 RoundingMode roundingMode = properties.getRoundingMode(); in getMathContextOr34Digits()
169 if (roundingMode == null) roundingMode = RoundingMode.HALF_EVEN; in getMathContextOr34Digits()
182 public static MathContext mathContextUnlimited(RoundingMode roundingMode) { in mathContextUnlimited()
/external/icu/android_icu4j/src/main/java/android/icu/impl/number/
DRoundingUtils.java8 import java.math.RoundingMode;
21 public static final RoundingMode DEFAULT_ROUNDING_MODE = RoundingMode.HALF_EVEN;
129 new MathContext[RoundingMode.values().length];
132 new MathContext[RoundingMode.values().length];
136 MATH_CONTEXT_BY_ROUNDING_MODE_UNLIMITED[i] = new MathContext(0, RoundingMode.valueOf(i));
152 RoundingMode roundingMode = properties.getRoundingMode(); in getMathContextOrUnlimited()
153 if (roundingMode == null) roundingMode = RoundingMode.HALF_EVEN; in getMathContextOrUnlimited()
170 RoundingMode roundingMode = properties.getRoundingMode(); in getMathContextOr34Digits()
171 if (roundingMode == null) roundingMode = RoundingMode.HALF_EVEN; in getMathContextOr34Digits()
184 public static MathContext mathContextUnlimited(RoundingMode roundingMode) { in mathContextUnlimited()
/external/icu/icu4c/source/test/intltest/
Dnumbertest_decimalquantity.cpp91 fq.roundToIncrement(0.005, RoundingMode::UNUM_ROUND_HALFEVEN, 3, status); in testDecimalQuantityBehaviorStandalone()
94 fq.roundToMagnitude(-2, RoundingMode::UNUM_ROUND_HALFEVEN, status); in testDecimalQuantityBehaviorStandalone()
113 fq.roundToMagnitude(5, RoundingMode::UNUM_ROUND_HALFEVEN, status); in testSwitchStorage()
239 RoundingMode roundingMode; in testUseApproximateDoubleWhenAble()
241 } cases[] = {{1.2345678, 1, RoundingMode::UNUM_ROUND_HALFEVEN, false}, in testUseApproximateDoubleWhenAble()
242 {1.2345678, 7, RoundingMode::UNUM_ROUND_HALFEVEN, false}, in testUseApproximateDoubleWhenAble()
243 {1.2345678, 12, RoundingMode::UNUM_ROUND_HALFEVEN, false}, in testUseApproximateDoubleWhenAble()
244 {1.2345678, 13, RoundingMode::UNUM_ROUND_HALFEVEN, true}, in testUseApproximateDoubleWhenAble()
245 {1.235, 1, RoundingMode::UNUM_ROUND_HALFEVEN, false}, in testUseApproximateDoubleWhenAble()
246 {1.235, 2, RoundingMode::UNUM_ROUND_HALFEVEN, true}, in testUseApproximateDoubleWhenAble()
[all …]
/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 …]
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 …]
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,
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/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/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);
DDoubleMath.java41 import java.math.RoundingMode;
57 static double roundIntermediate(double x, RoundingMode mode) { in roundIntermediate()
131 public static int roundToInt(double x, RoundingMode mode) { in roundToInt()
155 public static long roundToLong(double x, RoundingMode mode) { in roundToLong()
181 public static BigInteger roundToBigInteger(double x, RoundingMode mode) { in roundToBigInteger()
233 public static int log2(double x, RoundingMode mode) { in log2()
/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()
DIntMath.java26 import static java.math.RoundingMode.HALF_EVEN;
27 import static java.math.RoundingMode.HALF_UP;
32 import java.math.RoundingMode;
84 public static int log2(int x, RoundingMode mode) { in log2()
157 public static int divide(int p, int q, RoundingMode mode) { in divide()

1234