Home
last modified time | relevance | path

Searched refs:mc (Results 1 – 22 of 22) sorted by relevance

/libcore/luni/src/test/java/libcore/java/math/
DOldBigDecimalConstructorsTest.java39 MathContext mc = new MathContext(precision, rm); in testConstrBigIntegerMathContext() local
42 BigDecimal result = new BigDecimal(bA, mc); in testConstrBigIntegerMathContext()
52 mc = new MathContext(31, RoundingMode.UP); in testConstrBigIntegerMathContext()
53 bd = new BigDecimal(bi, mc); in testConstrBigIntegerMathContext()
55 bd = new BigDecimal(nbi, mc); in testConstrBigIntegerMathContext()
58 mc = new MathContext(28, RoundingMode.DOWN); in testConstrBigIntegerMathContext()
59 bd = new BigDecimal(bi, mc); in testConstrBigIntegerMathContext()
61 bd = new BigDecimal(nbi, mc); in testConstrBigIntegerMathContext()
64 mc = new MathContext(33, RoundingMode.CEILING); in testConstrBigIntegerMathContext()
65 bd = new BigDecimal(bi, mc); in testConstrBigIntegerMathContext()
[all …]
DOldBigDecimalArithmeticTest.java29 MathContext mc; in testAddMathContextNonTrivial() local
32 mc = new MathContext(17, RoundingMode.FLOOR); in testAddMathContextNonTrivial()
36 a.round(mc).toString()); in testAddMathContextNonTrivial()
38 b.round(mc).toString()); in testAddMathContextNonTrivial()
40 a.round(mc).add(b.round(mc)).toString()); in testAddMathContextNonTrivial()
41 res = a.add(b, mc); in testAddMathContextNonTrivial()
44 mc = new MathContext(33, RoundingMode.UNNECESSARY); in testAddMathContextNonTrivial()
47 res = a.add(b, mc); in testAddMathContextNonTrivial()
54 MathContext mc; in testSubtractMathContextNonTrivial() local
57 mc = new MathContext(17, RoundingMode.FLOOR); in testSubtractMathContextNonTrivial()
[all …]
DOldBigDecimalCompareTest.java35 MathContext mc = new MathContext(34, RoundingMode.UP); in testAbsMathContextNeg() local
36 …assertEquals("incorrect value", "1.238096483923847545735673567457357E+53", aNumber.abs(mc).toStrin… in testAbsMathContextNeg()
38 mc = new MathContext(34, RoundingMode.DOWN); in testAbsMathContextNeg()
39 …assertEquals("incorrect value", "1.238096483923847545735673567457356E+53", aNumber.abs(mc).toStrin… in testAbsMathContextNeg()
41 mc = new MathContext(34, RoundingMode.FLOOR); in testAbsMathContextNeg()
42 …assertEquals("incorrect value", "1.238096483923847545735673567457356E+53", aNumber.abs(mc).toStrin… in testAbsMathContextNeg()
44 mc = new MathContext(34, RoundingMode.CEILING); in testAbsMathContextNeg()
45 …assertEquals("incorrect value", "1.238096483923847545735673567457357E+53", aNumber.abs(mc).toStrin… in testAbsMathContextNeg()
47 mc = new MathContext(34, RoundingMode.UNNECESSARY); in testAbsMathContextNeg()
49 aNumber.abs(mc); in testAbsMathContextNeg()
[all …]
DMathContextTest.java26 MathContext mc = new MathContext("precision=1 roundingMode=" + rm); in testConstructor() local
27 assertEquals(1, mc.getPrecision()); in testConstructor()
28 assertEquals(rm, mc.getRoundingMode()); in testConstructor()
33 MathContext mc = new MathContext("precision=" + p + " roundingMode=" + RoundingMode.UP); in testConstructor() local
34 assertEquals(p, mc.getPrecision()); in testConstructor()
35 assertEquals(RoundingMode.UP, mc.getRoundingMode()); in testConstructor()
DOldBigDecimalConvertTest.java146 MathContext mc = new MathContext(iPresition, RoundingMode.UP); in test_ByteValueExactNeg() local
147 BigDecimal bdNumber = new BigDecimal(sNumber, mc); in test_ByteValueExactNeg()
158 MathContext mc = new MathContext(iPresition, RoundingMode.HALF_DOWN); in test_ByteValueExactCharZero() local
159 BigDecimal bdNumber = new BigDecimal(cNumber, mc); in test_ByteValueExactCharZero()
168 MathContext mc = new MathContext(iPresition, RoundingMode.HALF_UP); in test_ByteValueExactStringZero() local
169 BigDecimal bdNumber = new BigDecimal(sNumber, mc); in test_ByteValueExactStringZero()
258 MathContext mc = new MathContext(iPresition, RoundingMode.UP); in test_ByteValueNeg() local
259 BigDecimal bdNumber = new BigDecimal(sNumber, mc); in test_ByteValueNeg()
270 MathContext mc = new MathContext(iPresition, RoundingMode.HALF_UP); in test_ByteValueCharZero() local
271 BigDecimal bdNumber = new BigDecimal(cNumber, mc); in test_ByteValueCharZero()
[all …]
/libcore/ojluni/src/main/java/java/math/
DBigDecimal.java409 public BigDecimal(char[] in, int offset, int len, MathContext mc) { in BigDecimal() argument
507 int mcp = mc.precision; in BigDecimal()
513 … rs = divideAndRound(rs, LONG_TEN_POWERS_TABLE[drop], mc.roundingMode.oldMode); in BigDecimal()
570 int mcp = mc.precision; in BigDecimal()
576 rb = divideAndRoundByTenPow(rb, drop, mc.roundingMode.oldMode); in BigDecimal()
590 … rs = divideAndRound(rs, LONG_TEN_POWERS_TABLE[drop], mc.roundingMode.oldMode); in BigDecimal()
703 public BigDecimal(char[] in, MathContext mc) { in BigDecimal() argument
704 this(in, 0, in.length, mc); in BigDecimal()
826 public BigDecimal(String val, MathContext mc) { in BigDecimal() argument
827 this(val.toCharArray(), 0, val.length(), mc); in BigDecimal()
[all …]
DMathContext.java250 MathContext mc; in equals() local
253 mc = (MathContext) x; in equals()
254 return mc.precision == this.precision in equals()
255 && mc.roundingMode == this.roundingMode; // no need for .equals() in equals()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigDecimalConstructorsTest.java103 MathContext mc = new MathContext(precision, rm); in testConstrBigIntegerMathContext() local
106 BigDecimal result = new BigDecimal(bA, mc); in testConstrBigIntegerMathContext()
120 MathContext mc = new MathContext(precision, rm); in testConstrBigIntegerScaleMathContext() local
123 BigDecimal result = new BigDecimal(bA, aScale, mc); in testConstrBigIntegerScaleMathContext()
177 MathContext mc = new MathContext(precision, rm); in testConstrCharIntIntMathContext() local
178 BigDecimal result = new BigDecimal(value, offset, len, mc); in testConstrCharIntIntMathContext()
201 MathContext mc = new MathContext(precision, rm); in testConstrCharIntIntMathContextException1() local
203 new BigDecimal(value, offset, len, mc); in testConstrCharIntIntMathContextException1()
218 MathContext mc = new MathContext(precision, rm); in testConstrCharIntIntMathContextException2() local
220 new BigDecimal(value, offset, len, mc); in testConstrCharIntIntMathContextException2()
[all …]
DBigDecimalArithmeticTest.java61 MathContext mc = new MathContext(5, RoundingMode.UP); in testAddMathContextEqualScalePosPos() local
62 BigDecimal result = aNumber.add(bNumber, mc); in testAddMathContextEqualScalePosPos()
96 MathContext mc = new MathContext(5, RoundingMode.FLOOR); in testAddMathContextEqualScaleNegNeg() local
97 BigDecimal result = aNumber.add(bNumber, mc); in testAddMathContextEqualScaleNegNeg()
131 MathContext mc = new MathContext(15, RoundingMode.CEILING); in testAddMathContextDiffScalePosNeg() local
132 BigDecimal result = aNumber.add(bNumber, mc); in testAddMathContextDiffScalePosNeg()
200 MathContext mc = new MathContext(15, RoundingMode.CEILING); in testSubtractMathContextEqualScalePosPos() local
201 BigDecimal result = aNumber.subtract(bNumber, mc); in testSubtractMathContextEqualScalePosPos()
253 MathContext mc = new MathContext(17, RoundingMode.DOWN); in testSubtractMathContextDiffScalePosNeg() local
254 BigDecimal result = aNumber.subtract(bNumber, mc); in testSubtractMathContextDiffScalePosNeg()
[all …]
DBigDecimalCompareTest.java64 MathContext mc = new MathContext(precision, rm); in testAbsMathContextNeg() local
67 BigDecimal res = aNumber.abs(mc); in testAbsMathContextNeg()
80 MathContext mc = new MathContext(precision, rm); in testAbsMathContextPos() local
83 BigDecimal res = aNumber.abs(mc); in testAbsMathContextPos()
375 MathContext mc = new MathContext(precision, rm); in testPlusMathContextPositive() local
379 BigDecimal res = aNumber.plus(mc); in testPlusMathContextPositive()
405 MathContext mc = new MathContext(precision, rm); in testPlusMathContextNegative() local
409 BigDecimal res = aNumber.plus(mc); in testPlusMathContextNegative()
435 MathContext mc = new MathContext(precision, rm); in testNegateMathContextPositive() local
439 BigDecimal res = aNumber.negate(mc); in testNegateMathContextPositive()
[all …]
/libcore/ojluni/src/main/java/java/util/
DLinkedHashMap.java593 int mc = modCount; in forEach() local
595 for (LinkedHashMapEntry<K,V> e = head; (e != null && modCount == mc); e = e.after) in forEach()
597 if (modCount != mc) in forEach()
643 int mc = modCount; in forEach() local
645 for (LinkedHashMapEntry<K,V> e = head; (e != null && modCount == mc); e = e.after) in forEach()
647 if (modCount != mc) in forEach()
707 int mc = modCount; in forEach() local
709 for (LinkedHashMapEntry<K,V> e = head; (e != null && mc == modCount); e = e.after) in forEach()
711 if (modCount != mc) in forEach()
721 int mc = modCount; in forEach() local
[all …]
DWeakHashMap.java1113 int i, hi, mc; in forEachRemaining() local
1119 mc = expectedModCount = m.modCount; in forEachRemaining()
1123 mc = expectedModCount; in forEachRemaining()
1142 if (m.modCount != mc) in forEachRemaining()
1193 int i, hi, mc; in forEachRemaining() local
1199 mc = expectedModCount = m.modCount; in forEachRemaining()
1203 mc = expectedModCount; in forEachRemaining()
1220 if (m.modCount != mc) in forEachRemaining()
1271 int i, hi, mc; in forEachRemaining() local
1277 mc = expectedModCount = m.modCount; in forEachRemaining()
[all …]
DHashMap.java929 int mc = modCount; in forEach() local
931 for (int i = 0; (i < tab.length && modCount == mc); ++i) { in forEach()
935 if (modCount != mc) in forEach()
978 int mc = modCount; in forEach() local
980 for (int i = 0; (i < tab.length && modCount == mc); ++i) { in forEach()
984 if (modCount != mc) in forEach()
1042 int mc = modCount; in forEach() local
1044 for (int i = 0; (i < tab.length && modCount == mc); ++i) { in forEach()
1048 if (modCount != mc) in forEach()
1288 int mc = modCount; in forEach() local
[all …]
DTreeSet.java306 Comparator<? super E> mc = map.comparator(); in addAll() local
307 if (cc==mc || (cc != null && cc.equals(mc))) { in addAll()
DPriorityQueue.java856 int i, hi, mc; // hoist accesses and checks from loop in forEachRemaining() local
862 mc = q.modCount; in forEachRemaining()
866 mc = expectedModCount; in forEachRemaining()
874 else if (q.modCount != mc) in forEachRemaining()
DArrayList.java1376 int i, hi, mc; // hoist accesses and checks from loop in forEachRemaining() local
1382 mc = lst.modCount; in forEachRemaining()
1386 mc = expectedModCount; in forEachRemaining()
1392 if (lst.modCount == mc) in forEachRemaining()
DIdentityHashMap.java1434 int i, hi, mc; Object key; in forEachRemaining() local
1490 int i, hi, mc; in forEachRemaining() local
1549 int i, hi, mc; in forEachRemaining() local
DFormatter.java3662 MathContext mc = new MathContext(compPrec);
3664 = new BigDecimal(value.unscaledValue(), scale, mc);
/libcore/luni/src/test/java/tests/java/sql/
DStressTest.java246 int mc = conn.getMetaData().getMaxConnections(); in getConnectionNum() local
247 if (mc != 0) { in getConnectionNum()
248 if (num != mc) { in getConnectionNum()
249 System.err.println("Will be used no more than " + mc in getConnectionNum()
252 num = mc; in getConnectionNum()
/libcore/luni/src/test/java/tests/security/cert/
DCertificateFactory1Test.java428 MyCertificate mc = createMC(); in testCertificateFactory11() local
431 oos.writeObject(mc); in testCertificateFactory11()
538 MyCertPath mc = new MyCertPath(enc); in testCertificateFactory13() local
542 oos.writeObject(mc); in testCertificateFactory13()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DFormatterTest.java4202 MathContext mc = new MathContext(30); in test_ScientificNotation() local
4203 BigDecimal value = new BigDecimal(0.1, mc); in test_ScientificNotation()
DScannerTest.java517 MockCloseable mc = new MockCloseable(); in test_ioException() local
518 s = new Scanner(mc); in test_ioException()