/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/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 | 41 * @see RoundingMode#UP 48 * @see RoundingMode#DOWN 57 * @see RoundingMode#CEILING 66 * @see RoundingMode#FLOOR 74 * @see RoundingMode#HALF_UP 82 * @see RoundingMode#HALF_DOWN 90 * @see RoundingMode#HALF_EVEN 99 * @see RoundingMode#UNNECESSARY 369 * if {@code mc.precision > 0} and {@code mc.roundingMode == 407 * if {@code mc.precision > 0} and {@code mc.roundingMode = [all...] |
/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...] |
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...] |
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...] |
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...] |
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);
|
BigDecimalTest.java | 21 import java.math.RoundingMode; 64 BigDecimal rounded = bigDecimal.round(new MathContext(2, RoundingMode.FLOOR)); 96 assertEquals("1.20", a.abs(new MathContext(3,RoundingMode.HALF_UP)).toPlainString());
|
/external/apache-harmony/text/src/test/java/org/apache/harmony/text/tests/java/text/ |
DecimalFormatTest.java | 23 import java.math.RoundingMode; [all...] |
/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...] |
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...] |
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...] |
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...] |
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...] |
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/ |
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...] |
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...] |
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...] |
/external/llvm/include/llvm/ADT/ |
APFloat.h | 155 enum roundingMode { 293 opStatus add(const APFloat &, roundingMode); 294 opStatus subtract(const APFloat &, roundingMode); 295 opStatus multiply(const APFloat &, roundingMode); 296 opStatus divide(const APFloat &, roundingMode); 300 opStatus mod(const APFloat &, roundingMode); 301 opStatus fusedMultiplyAdd(const APFloat &, const APFloat &, roundingMode); 302 opStatus roundToIntegral(roundingMode); 320 opStatus convert(const fltSemantics &, roundingMode, bool *); 321 opStatus convertToInteger(integerPart *, unsigned int, bool, roundingMode, [all...] |
/external/guava/guava/src/com/google/common/math/ |
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...] |
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...] |
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...] |
/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)]);
|