HomeSort by relevance Sort by last modified time
    Searched refs:RoundingMode (Results 1 - 25 of 55) sorted by null

1 2 3

  /libcore/luni/src/test/java/tests/api/java/math/
RoundingModeTest.java 21 import java.math.RoundingMode;
26 * java.math.RoundingMode#valueOf(int)
29 assertEquals("valueOf failed for ROUND_CEILING", RoundingMode.valueOf(BigDecimal.ROUND_CEILING), RoundingMode.CEILING);
30 assertEquals("valueOf failed for ROUND_DOWN", RoundingMode.valueOf(BigDecimal.ROUND_DOWN), RoundingMode.DOWN);
31 assertEquals("valueOf failed for ROUND_FLOOR", RoundingMode.valueOf(BigDecimal.ROUND_FLOOR), RoundingMode.FLOOR);
32 assertEquals("valueOf failed for ROUND_HALF_DOWN", RoundingMode.valueOf(BigDecimal.ROUND_HALF_DOWN), RoundingMode.HALF_DOWN)
    [all...]
MathContextTest.java 22 import java.math.RoundingMode;
32 MathContext mcIntRm6hd = new MathContext(6, RoundingMode.HALF_DOWN);
33 MathContext mcStr6hd = new MathContext("precision=6 roundingMode=HALF_DOWN");
45 RoundingMode.HALF_UP,
48 RoundingMode.HALF_DOWN, mcIntRm6hd.getRoundingMode() );
52 "precision=6 roundingMode=HALF_DOWN", mcIntRm6hd.toString() );
54 "precision=6 roundingMode=HALF_UP", mcInt6.toString() );
  /libcore/luni/src/test/java/libcore/java/math/
MathContextTest.java 20 import java.math.RoundingMode;
25 for (RoundingMode rm : RoundingMode.values()) {
26 MathContext mc = new MathContext("precision=1 roundingMode=" + rm);
33 MathContext mc = new MathContext("precision=" + p + " roundingMode=" + RoundingMode.UP);
35 assertEquals(RoundingMode.UP, mc.getRoundingMode());
39 new MathContext("precision=1 roundingMode=UP");
41 new MathContext("Precision=1 roundingMode=UP");
46 new MathContext("precision=1 RoundingMode=UP")
    [all...]
OldBigDecimalCompareTest.java 27 import java.math.RoundingMode;
35 MathContext mc = new MathContext(34, RoundingMode.UP);
38 mc = new MathContext(34, RoundingMode.DOWN);
41 mc = new MathContext(34, RoundingMode.FLOOR);
44 mc = new MathContext(34, RoundingMode.CEILING);
47 mc = new MathContext(34, RoundingMode.UNNECESSARY);
50 fail("No ArithmeticException for RoundingMode.UNNECESSARY");
57 MathContext mc = new MathContext(37, RoundingMode.FLOOR);
OldBigDecimalTest.java 22 import java.math.RoundingMode;
70 * java.math.BigDecimal#setScale(int, java.math.RoundingMode)
81 setScale2 = setScale1.setScale(17, RoundingMode.CEILING);
88 // testing rounding Mode RoundingMode.CEILING
90 setScale2 = setScale1.setScale(1, RoundingMode.CEILING);
92 "the number 1234.5908 after setting scale to 1/RoundingMode.CEILING is wrong",
95 setScale2 = setNeg.setScale(1, RoundingMode.CEILING);
97 "the number -1234.5908 after setting scale to 1/RoundingMode.CEILING is wrong",
101 // testing rounding Mode RoundingMode.DOWN
102 setScale2 = setNeg.setScale(1, RoundingMode.DOWN)
    [all...]
OldBigDecimalConstructorsTest.java 26 import java.math.RoundingMode;
38 RoundingMode rm = RoundingMode.CEILING;
46 // Now test more than just RoundingMode.CEILING:
52 mc = new MathContext(31, RoundingMode.UP);
58 mc = new MathContext(28, RoundingMode.DOWN);
64 mc = new MathContext(33, RoundingMode.CEILING);
70 mc = new MathContext(34, RoundingMode.FLOOR);
76 mc = new MathContext(34, RoundingMode.HALF_EVEN);
84 mc = new MathContext(34, RoundingMode.HALF_UP)
    [all...]
OldBigDecimalArithmeticTest.java 23 import java.math.RoundingMode;
32 mc = new MathContext(17, RoundingMode.FLOOR);
44 mc = new MathContext(33, RoundingMode.UNNECESSARY);
57 mc = new MathContext(17, RoundingMode.FLOOR);
67 mc = new MathContext(33, RoundingMode.UNNECESSARY);
80 mc = new MathContext(17, RoundingMode.FLOOR);
118 MathContext mc = new MathContext(5, RoundingMode.HALF_UP);
128 mc = new MathContext(7, RoundingMode.FLOOR);
135 mc = new MathContext(4, RoundingMode.FLOOR);
142 mc = new MathContext(2, RoundingMode.UNNECESSARY)
    [all...]
BigDecimalTest.java 21 import java.math.RoundingMode;
64 BigDecimal rounded = bigDecimal.round(new MathContext(2, RoundingMode.FLOOR));
OldBigDecimalConvertTest.java 26 import java.math.RoundingMode;
146 MathContext mc = new MathContext(iPresition, RoundingMode.UP);
158 MathContext mc = new MathContext(iPresition, RoundingMode.HALF_DOWN);
168 MathContext mc = new MathContext(iPresition, RoundingMode.HALF_UP);
262 MathContext mc = new MathContext(iPresition, RoundingMode.UP);
274 MathContext mc = new MathContext(iPresition, RoundingMode.HALF_UP);
284 MathContext mc = new MathContext(iPresition, RoundingMode.HALF_UP);
  /libcore/luni/src/main/java/java/math/
MathContext.java 35 * {@link RoundingMode#HALF_EVEN} rounding.
37 public static final MathContext DECIMAL128 = new MathContext(34, RoundingMode.HALF_EVEN);
41 * precision format: 7 digit precision and {@link RoundingMode#HALF_EVEN}
44 public static final MathContext DECIMAL32 = new MathContext(7, RoundingMode.HALF_EVEN);
48 * precision format: 16 digit precision and {@link RoundingMode#HALF_EVEN}
51 public static final MathContext DECIMAL64 = new MathContext(16, RoundingMode.HALF_EVEN);
55 * {@link RoundingMode#HALF_UP} rounding.
57 public static final MathContext UNLIMITED = new MathContext(0, RoundingMode.HALF_UP);
66 * A {@code RoundingMode} object which specifies the algorithm to be used
69 private final RoundingMode roundingMode
    [all...]
RoundingMode.java 24 public enum RoundingMode {
88 RoundingMode(int rm) {
94 * {@code RoundingMode} values.
100 public static RoundingMode valueOf(int mode) {
  /external/guava/guava-tests/test/com/google/common/math/
BigIntegerMathTest.java 29 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;
45 import java.math.RoundingMode;
68 for (RoundingMode mode : ALL_ROUNDING_MODES)
    [all...]
IntMathTest.java 27 import static java.math.RoundingMode.FLOOR;
28 import static java.math.RoundingMode.UNNECESSARY;
38 import java.math.RoundingMode;
99 for (RoundingMode mode : ALL_ROUNDING_MODES) {
110 for (RoundingMode mode : ALL_ROUNDING_MODES) {
123 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) {
146 for (RoundingMode mode : ALL_ROUNDING_MODES) {
157 for (RoundingMode mode : ALL_ROUNDING_MODES) {
170 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) {
195 for (RoundingMode mode : ALL_ROUNDING_MODES)
    [all...]
DoubleMathTest.java 26 import static java.math.RoundingMode.CEILING;
27 import static java.math.RoundingMode.DOWN;
28 import static java.math.RoundingMode.FLOOR;
29 import static java.math.RoundingMode.HALF_DOWN;
30 import static java.math.RoundingMode.HALF_EVEN;
31 import static java.math.RoundingMode.HALF_UP;
32 import static java.math.RoundingMode.UNNECESSARY;
33 import static java.math.RoundingMode.UP;
42 import java.math.RoundingMode;
74 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES)
    [all...]
MathTesting.java 21 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
    [all...]
LongMathTest.java 30 import static java.math.RoundingMode.FLOOR;
31 import static java.math.RoundingMode.UNNECESSARY;
39 import java.math.RoundingMode;
140 for (RoundingMode mode : ALL_ROUNDING_MODES) {
150 for (RoundingMode mode : ALL_ROUNDING_MODES) {
162 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) {
184 for (RoundingMode mode : ALL_ROUNDING_MODES) {
194 for (RoundingMode mode : ALL_ROUNDING_MODES) {
206 for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) {
228 for (RoundingMode mode : ALL_ROUNDING_MODES)
    [all...]
  /external/apache-harmony/math/src/test/java/org/apache/harmony/tests/java/math/
BigDecimalArithmeticTest.java 23 import java.math.RoundingMode;
61 MathContext mc = new MathContext(5, RoundingMode.UP);
96 MathContext mc = new MathContext(5, RoundingMode.FLOOR);
131 MathContext mc = new MathContext(15, RoundingMode.CEILING);
200 MathContext mc = new MathContext(15, RoundingMode.CEILING);
253 MathContext mc = new MathContext(17, RoundingMode.DOWN);
289 MathContext mc = new MathContext(70, RoundingMode.HALF_DOWN);
324 MathContext mc = new MathContext(40, RoundingMode.HALF_DOWN);
376 MathContext mc = new MathContext(53, RoundingMode.HALF_UP);
411 MathContext mc = new MathContext(47, RoundingMode.HALF_UP)
    [all...]
BigDecimalConstructorsTest.java 26 import java.math.RoundingMode;
102 RoundingMode rm = RoundingMode.CEILING;
119 RoundingMode rm = RoundingMode.CEILING;
176 RoundingMode rm = RoundingMode.CEILING;
200 RoundingMode rm = RoundingMode.CEILING;
217 RoundingMode rm = RoundingMode.CEILING
    [all...]
BigDecimalCompareTest.java 26 import java.math.RoundingMode;
63 RoundingMode rm = RoundingMode.HALF_DOWN;
79 RoundingMode rm = RoundingMode.HALF_EVEN;
374 RoundingMode rm = RoundingMode.FLOOR;
404 RoundingMode rm = RoundingMode.CEILING;
434 RoundingMode rm = RoundingMode.FLOOR
    [all...]
  /libcore/luni/src/main/java/java/text/
DecimalFormat.java 26 import java.math.RoundingMode;
515 private transient RoundingMode roundingMode = RoundingMode.HALF_EVEN;
675 if (roundingMode == RoundingMode.UNNECESSARY) {
678 setRoundingMode(RoundingMode.UP);
680 setRoundingMode(RoundingMode.DOWN);
686 setRoundingMode(RoundingMode.UNNECESSARY);
    [all...]
  /external/guava/guava/src/com/google/common/math/
IntMath.java 26 import static java.math.RoundingMode.HALF_EVEN;
27 import static java.math.RoundingMode.HALF_UP;
35 import java.math.RoundingMode;
71 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
76 public static int log2(int x, RoundingMode mode) {
112 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
117 public static int log10(int x, RoundingMode mode) {
202 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and
207 public static int sqrt(int x, RoundingMode mode) {
242 * {@code RoundingMode}
    [all...]
BigIntegerMath.java 24 import static java.math.RoundingMode.CEILING;
25 import static java.math.RoundingMode.FLOOR;
26 import static java.math.RoundingMode.HALF_EVEN;
33 import java.math.RoundingMode;
63 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
67 public static int log2(BigInteger x, RoundingMode mode) {
122 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
126 public static int log10(BigInteger x, RoundingMode mode) {
178 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and
182 public static BigInteger sqrt(BigInteger x, RoundingMode mode)
    [all...]
DoubleMath.java 33 import java.math.RoundingMode;
50 static double roundIntermediate(double x, RoundingMode mode) {
108 * {@link RoundingMode#UNNECESSARY}
111 public static int roundToInt(double x, RoundingMode mode) {
131 * {@link RoundingMode#UNNECESSARY}
134 public static long roundToLong(double x, RoundingMode mode) {
155 * {@link RoundingMode#UNNECESSARY}
158 public static BigInteger roundToBigInteger(double x, RoundingMode mode) {
193 * {@link #log2(double, RoundingMode)} is faster.
211 public static int log2(double x, RoundingMode mode)
    [all...]
LongMath.java 27 import static java.math.RoundingMode.HALF_EVEN;
28 import static java.math.RoundingMode.HALF_UP;
34 import java.math.RoundingMode;
68 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
72 public static int log2(long x, RoundingMode mode) {
108 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
112 public static int log10(long x, RoundingMode mode) {
239 * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and
243 public static long sqrt(long x, RoundingMode mode) {
290 * {@code RoundingMode}
    [all...]
  /external/guava/guava/src/com/google/common/hash/
BloomFilterStrategies.java 9 import java.math.RoundingMode;
65 this(new long[IntMath.divide(bits, 64, RoundingMode.CEILING)]);

Completed in 1295 milliseconds

1 2 3