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

1 2

  /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) {
BigDecimal.java 47 * @see RoundingMode#UP
54 * @see RoundingMode#DOWN
63 * @see RoundingMode#CEILING
72 * @see RoundingMode#FLOOR
80 * @see RoundingMode#HALF_UP
88 * @see RoundingMode#HALF_DOWN
96 * @see RoundingMode#HALF_EVEN
105 * @see RoundingMode#UNNECESSARY
379 * if {@code mc.precision > 0} and {@code mc.roundingMode ==
417 * if {@code mc.precision > 0} and {@code mc.roundingMode =
    [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...]
BigDecimalScaleOperationsTest.java 238 * SetScale(int, RoundingMode)
245 BigDecimal result = aNumber.setScale(newScale, RoundingMode.HALF_EVEN);
  /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...]
NumberFormat.java 26 import java.math.RoundingMode;
826 * Returns the {@code RoundingMode} used by this {@code NumberFormat}. The default
831 public RoundingMode getRoundingMode() {
836 * Sets the {@code RoundingMode} used by this {@code NumberFormat}. The default
841 public void setRoundingMode(RoundingMode roundingMode) {
  /external/apache-harmony/text/src/test/java/org/apache/harmony/text/tests/java/text/
DecimalFormatTest.java 23 import java.math.RoundingMode;
    [all...]
NumberFormatTest.java 19 import java.math.RoundingMode;
269 * @test java.text.NumberFormat#setRoundingMode(java.math.RoundingMode)
274 // RoundingMode
286 * @test java.text.NumberFormat#setRoundingMode(java.math.RoundingMode)
291 // RoundingMode
294 ((NumberFormat) choiceFormat).setRoundingMode(RoundingMode.CEILING);
  /libcore/luni/src/test/java/libcore/java/text/
DecimalFormatTest.java 21 import java.math.RoundingMode;
41 df.setRoundingMode(RoundingMode.HALF_UP);
  /dalvik/tests/003-omnibus-opcodes/src/
Classes.java 43 java.math.RoundingMode mode = (java.math.RoundingMode) thisRef;
  /external/webkit/Source/WebCore/platform/graphics/
GraphicsContext.h 387 enum RoundingMode {
391 FloatRect roundToDevicePixels(const FloatRect&, RoundingMode = RoundAllSides);
  /libcore/luni/src/main/java/libcore/icu/
NativeDecimalFormat.java 21 import java.math.RoundingMode;
489 public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) {
491 switch (roundingMode) {
639 private static native void setRoundingMode(int addr, int roundingMode, double roundingIncrement);
  /external/webkit/Source/WebCore/platform/graphics/openvg/
GraphicsContextOpenVG.cpp 260 FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect, RoundingMode)

Completed in 215 milliseconds

1 2