/libcore/benchmarks/src/benchmarks/regression/ |
D | MathBenchmark.java | 35 double result = d; in timeAbsD() local 37 result = Math.abs(d); in timeAbsD() 39 return result; in timeAbsD() 43 float result = f; in timeAbsF() local 45 result = Math.abs(f); in timeAbsF() 47 return result; in timeAbsF() 51 int result = i; in timeAbsI() local 53 result = Math.abs(i); in timeAbsI() 55 return result; in timeAbsI() 59 long result = l; in timeAbsL() local [all …]
|
D | IntConstantMultiplicationBenchmark.java | 21 int result = 1; in timeMultiplyIntByConstant6() local 23 result *= 6; in timeMultiplyIntByConstant6() 25 return result; in timeMultiplyIntByConstant6() 28 int result = 1; in timeMultiplyIntByConstant7() local 30 result *= 7; in timeMultiplyIntByConstant7() 32 return result; in timeMultiplyIntByConstant7() 35 int result = 1; in timeMultiplyIntByConstant8() local 37 result *= 8; in timeMultiplyIntByConstant8() 39 return result; in timeMultiplyIntByConstant8() 42 int result = 1; in timeMultiplyIntByConstant8_Shift() local [all …]
|
D | IntConstantDivisionBenchmark.java | 21 int result = 1; in timeDivideIntByConstant2() local 23 result /= 2; in timeDivideIntByConstant2() 25 return result; in timeDivideIntByConstant2() 28 int result = 1; in timeDivideIntByConstant8() local 30 result /= 8; in timeDivideIntByConstant8() 32 return result; in timeDivideIntByConstant8() 35 int result = 1; in timeDivideIntByConstant10() local 37 result /= 10; in timeDivideIntByConstant10() 39 return result; in timeDivideIntByConstant10() 42 int result = 1; in timeDivideIntByConstant100() local [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/ |
D | BigDecimalConvertTest.java | 39 double result = -1.2380964839238476E53; in testDoubleValueNeg() local 40 assertEquals("incorrect value", result, aNumber.doubleValue(), 0); in testDoubleValueNeg() 49 double result = 1.2380964839238476E53; in testDoubleValuePos() local 50 assertEquals("incorrect value", result, aNumber.doubleValue(), 0); in testDoubleValuePos() 59 double result = Double.POSITIVE_INFINITY; in testDoubleValuePosInfinity() local 60 assertEquals("incorrect value", result, aNumber.doubleValue(), 0); in testDoubleValuePosInfinity() 69 double result = Double.NEGATIVE_INFINITY; in testDoubleValueNegInfinity() local 70 assertEquals("incorrect value", result, aNumber.doubleValue(), 0); in testDoubleValueNegInfinity() 80 double result = aNumber.doubleValue(); in testDoubleValueMinusZero() local 81 assertTrue("incorrect value", Double.doubleToLongBits(result) == minusZero); in testDoubleValueMinusZero() [all …]
|
D | BigIntegerOperateBitsTest.java | 148 BigInteger result = aNumber.clearBit(number); in testClearBitZero() local 150 resBytes = result.toByteArray(); in testClearBitZero() 154 assertEquals("incorrect sign", 0, result.signum()); in testClearBitZero() 166 BigInteger result = aNumber.clearBit(number); in testClearBitZeroOutside1() local 168 resBytes = result.toByteArray(); in testClearBitZeroOutside1() 172 assertEquals("incorrect sign", 0, result.signum()); in testClearBitZeroOutside1() 184 BigInteger result = aNumber.clearBit(number); in testClearBitNegativeInside1() local 186 resBytes = result.toByteArray(); in testClearBitNegativeInside1() 190 assertEquals("incorrect sign", -1, result.signum()); in testClearBitNegativeInside1() 202 BigInteger result = aNumber.clearBit(number); in testClearBitNegativeInside2() local [all …]
|
D | BigDecimalArithmeticTest.java | 44 BigDecimal result = aNumber.add(bNumber); in testAddEqualScalePosPos() local 45 assertEquals("incorrect value", c, result.toString()); in testAddEqualScalePosPos() 46 assertEquals("incorrect scale", cScale, result.scale()); in testAddEqualScalePosPos() 62 BigDecimal result = aNumber.add(bNumber, mc); in testAddMathContextEqualScalePosPos() local 63 assertEquals("incorrect value", c, result.toString()); in testAddMathContextEqualScalePosPos() 64 assertEquals("incorrect scale", cScale, result.scale()); in testAddMathContextEqualScalePosPos() 79 BigDecimal result = aNumber.add(bNumber); in testAddEqualScaleNegNeg() local 80 assertEquals("incorrect value", c, result.toString()); in testAddEqualScaleNegNeg() 81 assertEquals("incorrect scale", cScale, result.scale()); in testAddEqualScaleNegNeg() 97 BigDecimal result = aNumber.add(bNumber, mc); in testAddMathContextEqualScaleNegNeg() local [all …]
|
D | BigIntegerAddTest.java | 42 BigInteger result = aNumber.add(bNumber); in testCase1() local 44 resBytes = result.toByteArray(); in testCase1() 48 assertEquals("incorrect sign", 1, result.signum()); in testCase1() 62 BigInteger result = aNumber.add(bNumber); in testCase2() local 64 resBytes = result.toByteArray(); in testCase2() 68 assertEquals("incorrect sign", -1, result.signum()); in testCase2() 84 BigInteger result = aNumber.add(bNumber); in testCase3() local 86 resBytes = result.toByteArray(); in testCase3() 90 assertEquals("incorrect sign", 1, result.signum()); in testCase3() 106 BigInteger result = aNumber.add(bNumber); in testCase4() local [all …]
|
D | BigIntegerAndTest.java | 42 BigInteger result = aNumber.and(bNumber); in testZeroPos() local 44 resBytes = result.toByteArray(); in testZeroPos() 48 assertEquals("incorrect sign", 0, result.signum()); in testZeroPos() 62 BigInteger result = aNumber.and(bNumber); in testZeroNeg() local 64 resBytes = result.toByteArray(); in testZeroNeg() 68 assertEquals("incorrect sign", 0, result.signum()); in testZeroNeg() 82 BigInteger result = aNumber.and(bNumber); in testPosZero() local 84 resBytes = result.toByteArray(); in testPosZero() 88 assertEquals("incorrect sign", 0, result.signum()); in testPosZero() 102 BigInteger result = aNumber.and(bNumber); in testNegPos() local [all …]
|
D | BigIntegerSubtractTest.java | 43 BigInteger result = aNumber.subtract(bNumber); in testCase1() local 45 resBytes = result.toByteArray(); in testCase1() 49 assertEquals(1, result.signum()); in testCase1() 64 BigInteger result = aNumber.subtract(bNumber); in testCase2() local 66 resBytes = result.toByteArray(); in testCase2() 70 assertEquals(-1, result.signum()); in testCase2() 86 BigInteger result = aNumber.subtract(bNumber); in testCase3() local 88 resBytes = result.toByteArray(); in testCase3() 92 assertEquals(1, result.signum()); in testCase3() 108 BigInteger result = aNumber.subtract(bNumber); in testCase4() local [all …]
|
D | BigIntegerDivideTest.java | 74 BigInteger result = aNumber.divide(bNumber); in testCase3() local 76 resBytes = result.toByteArray(); in testCase3() 80 assertEquals("incorrect sign", 1, result.signum()); in testCase3() 94 BigInteger result = aNumber.divide(bNumber); in testCase4() local 96 resBytes = result.toByteArray(); in testCase4() 100 assertEquals("incorrect sign", -1, result.signum()); in testCase4() 115 BigInteger result = aNumber.divide(bNumber); in testCase5() local 117 resBytes = result.toByteArray(); in testCase5() 121 assertEquals("incorrect sign", 0, result.signum()); in testCase5() 136 BigInteger result = aNumber.divide(bNumber); in testCase6() local [all …]
|
D | BigIntegerConvertTest.java | 37 double result = 0.0; in testDoubleValueZero() local 39 assertTrue(aNumber == result); in testDoubleValueZero() 48 double result = 2.7467238945E10; in testDoubleValuePositive1() local 50 assertTrue(aNumber == result); in testDoubleValuePositive1() 59 double result = 2.7467238945723645E36; in testDoubleValuePositive2() local 61 assertTrue(aNumber == result); in testDoubleValuePositive2() 70 double result = -2.7467238945E10; in testDoubleValueNegative1() local 72 assertTrue(aNumber == result); in testDoubleValueNegative1() 81 double result = -2.7467238945723645E36; in testDoubleValueNegative2() local 83 assertTrue(aNumber == result); in testDoubleValueNegative2() [all …]
|
D | BigIntegerOrTest.java | 42 BigInteger result = aNumber.or(bNumber); in testZeroPos() local 44 resBytes = result.toByteArray(); in testZeroPos() 48 assertEquals("incorrect sign", 1, result.signum()); in testZeroPos() 62 BigInteger result = aNumber.or(bNumber); in testZeroNeg() local 64 resBytes = result.toByteArray(); in testZeroNeg() 68 assertEquals("incorrect sign", -1, result.signum()); in testZeroNeg() 82 BigInteger result = aNumber.or(bNumber); in testPosZero() local 84 resBytes = result.toByteArray(); in testPosZero() 88 assertEquals("incorrect sign", 1, result.signum()); in testPosZero() 102 BigInteger result = aNumber.or(bNumber); in testNegPos() local [all …]
|
D | BigIntegerMultiplyTest.java | 42 BigInteger result = aNumber.multiply(bNumber); in testCase1() local 44 resBytes = result.toByteArray(); in testCase1() 48 assertEquals("incorrect sign", 1, result.signum()); in testCase1() 63 BigInteger result = aNumber.multiply(bNumber); in testCase2() local 65 resBytes = result.toByteArray(); in testCase2() 69 assertEquals("incorrect sign", -1, result.signum()); in testCase2() 85 BigInteger result = aNumber.multiply(bNumber); in testCase3() local 87 resBytes = result.toByteArray(); in testCase3() 91 assertEquals("incorrect sign", 1, result.signum()); in testCase3() 107 BigInteger result = aNumber.multiply(bNumber); in testCase4() local [all …]
|
D | BigIntegerXorTest.java | 40 BigInteger result = aNumber.xor(bNumber); in testZeroPos() local 41 assertTrue(res.equals(result.toString())); in testZeroPos() 53 BigInteger result = aNumber.xor(bNumber); in testZeroNeg() local 54 assertTrue(res.equals(result.toString())); in testZeroNeg() 66 BigInteger result = aNumber.xor(bNumber); in testPosZero() local 67 assertTrue(res.equals(result.toString())); in testPosZero() 79 BigInteger result = aNumber.xor(bNumber); in testNegPos() local 80 assertTrue(res.equals(result.toString())); in testNegPos() 92 BigInteger result = aNumber.xor(bNumber); in testZeroZero() local 93 assertTrue(res.equals(result.toString())); in testZeroZero() [all …]
|
/libcore/ojluni/src/test/java/math/BigDecimal/ |
D | ZeroScalingTests.java | 73 BigDecimal result = zero1.add(zero2); in addTests() local 75 Assert.assertEquals(result, expected, "For classic exact add, expected scale of " + in addTests() 77 result.scale() + "."); in addTests() 79 result = zero1.add(zero2, MathContext.UNLIMITED); in addTests() 80 Assert.assertEquals(result, expected, "For UNLIMITED math context add," + in addTests() 83 result.scale() + "."); in addTests() 85 result = zero1.add(zero2, longEnough); in addTests() 86 Assert.assertEquals(result, expected, "For longEnough math context add," + in addTests() 89 result.scale() + "."); in addTests() 107 BigDecimal result = element.add(zero, mc); in addTests() local [all …]
|
/libcore/ojluni/src/test/java/lang/Math/ |
D | Tests.java | 238 boolean result, boolean expected) { in test() argument 239 Assert.assertEquals(result, expected, "Failure for " + testName + ":\n" + in test() 242 "\tgot " + result + ")."); in test() 246 boolean result, boolean expected) { in test() argument 247 Assert.assertEquals(result, expected, "Failure for " + testName + ":\n" + in test() 250 "\tgot " + result + ")."); in test() 254 boolean result, boolean expected) { in test() argument 255 Assert.assertEquals(result, expected, "Failure for " + testName + ":\n" + in test() 259 "\tgot " + result + ")."); in test() 263 boolean result, boolean expected) { in test() argument [all …]
|
/libcore/benchmarks/src/benchmarks/ |
D | FieldAccessBenchmark.java | 34 int result = 0; in timeField() local 36 result = intVal; in timeField() 38 return result; in timeField() 41 int result = 0; in timeFieldFinal() local 43 result = finalIntVal; in timeFieldFinal() 45 return result; in timeFieldFinal() 48 int result = 0; in timeFieldStatic() local 50 result = staticIntVal; in timeFieldStatic() 52 return result; in timeFieldStatic() 55 int result = 0; in timeFieldStaticFinal() local [all …]
|
D | AdditionBenchmark.java | 24 int result = 0; in timeAddConstantToLocalInt() local 26 result += 123; in timeAddConstantToLocalInt() 28 return result; in timeAddConstantToLocalInt() 31 int result = 0; in timeAddTwoLocalInts() local 34 result += constant; in timeAddTwoLocalInts() 36 return result; in timeAddTwoLocalInts() 39 long result = 0; in timeAddConstantToLocalLong() local 41 result += 123L; in timeAddConstantToLocalLong() 43 return result; in timeAddConstantToLocalLong() 46 long result = 0; in timeAddTwoLocalLongs() local [all …]
|
/libcore/luni/src/test/java/libcore/javax/xml/transform/sax/ |
D | SAXResultTest.java | 35 private SAXResult result; field in SAXResultTest 39 result = new SAXResult(); in setUp() 44 result = new SAXResult(); in constructor() 45 assertNull(result.getHandler()); in constructor() 46 assertNull(result.getLexicalHandler()); in constructor() 47 assertNull(result.getSystemId()); in constructor() 53 result = new SAXResult(handler); in constructor_withContentHandler() 54 assertEquals(handler, result.getHandler()); in constructor_withContentHandler() 55 assertNull(result.getLexicalHandler()); in constructor_withContentHandler() 56 assertNull(result.getSystemId()); in constructor_withContentHandler() [all …]
|
/libcore/ojluni/src/main/java/java/util/ |
D | EnumSet.java | 136 EnumSet<E> result = noneOf(elementType); in allOf() local 137 result.addAll(); in allOf() 138 return result; in allOf() 182 EnumSet<E> result = EnumSet.of(first); in copyOf() local 184 result.add(i.next()); in copyOf() 185 return result; in copyOf() 200 EnumSet<E> result = copyOf(s); in complementOf() local 201 result.complement(); in complementOf() 202 return result; in complementOf() 220 EnumSet<E> result = noneOf(e.getDeclaringClass()); in of() local [all …]
|
/libcore/ojluni/src/test/java/text/Format/DecimalFormat/ |
D | Bug8165466.java | 47 String result = nf.format(d); in main() local 48 if (!result.equals("0.006%")) { in main() 50 + " value: " + d + " Expected: 0.006%, Found: " + result in main() 55 result = nf.format(d); in main() 56 if (!result.equals("0%")) { in main() 58 + " value: " + d + " Expected: 0%, Found: " + result in main() 63 result = nf.format(d); in main() 64 if (!result.equals("0.006%")) { in main() 66 + " value: " + d + " Expected: 0.006%, Found: " + result in main() 72 result = nf.format(d); in main() [all …]
|
/libcore/luni/src/test/java/tests/java/sql/ |
D | MultiThreadAccessTest.java | 163 ResultSet result = statement.executeQuery(selectQuery + id1); in test_MultipleOperationsInSeveralTables() local 164 assertFalse("The record was not deleted", result.next()); in test_MultipleOperationsInSeveralTables() 166 result = statement.executeQuery(selectQuery + id2); in test_MultipleOperationsInSeveralTables() 167 assertTrue("The record was not inserted", result.next()); in test_MultipleOperationsInSeveralTables() 170 + id2, result.getString("field1")); in test_MultipleOperationsInSeveralTables() 172 assertEquals("Wrong value of field2", Integer.valueOf(id2).intValue(), result in test_MultipleOperationsInSeveralTables() 174 assertEquals("Wrong value of field3", Integer.valueOf(id2).intValue(), result in test_MultipleOperationsInSeveralTables() 176 result.close(); in test_MultipleOperationsInSeveralTables() 178 result = statement.executeQuery(selectQuery + oldID); in test_MultipleOperationsInSeveralTables() 179 assertFalse("The record was not deleted", result.next()); in test_MultipleOperationsInSeveralTables() [all …]
|
D | SelectFunctionalityTest.java | 132 ResultSet result = statement.executeQuery(sql); in test_SelectSimple() local 135 while (result.next()) { in test_SelectSimple() 136 int id = result.getInt("finteger"); in test_SelectSimple() 138 DatabaseCreator.defaultString + id, result in test_SelectSimple() 141 DatabaseCreator.defaultCharacter + id, result in test_SelectSimple() 152 .valueOf(id + 0.1).floatValue(), result.getFloat("ffloat")); in test_SelectSimple() 154 .valueOf(id + 0.1).doubleValue(), result.getDouble("freal")); in test_SelectSimple() 156 .valueOf(id + 0.1).doubleValue(), result in test_SelectSimple() 159 date.toString(), result.getDate("fdate").toString()); in test_SelectSimple() 161 time.toString(), result.getTime("ftime").toString()); in test_SelectSimple() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | ListResourceBundleTest.java | 36 Vector<String> result = new Vector<String>(); in test_getKeys() local 38 result.addElement(keys.nextElement()); in test_getKeys() 40 assertTrue("Missing key parent1", result.contains("parent1")); in test_getKeys() 41 assertTrue("Missing key parent2", result.contains("parent2")); in test_getKeys() 42 assertTrue("Missing key parent3", result.contains("parent3")); in test_getKeys() 43 assertTrue("Missing key parent4", result.contains("parent4")); in test_getKeys() 44 assertTrue("Missing key child1", result.contains("child1")); in test_getKeys() 45 assertTrue("Missing key child2", result.contains("child2")); in test_getKeys() 46 assertTrue("Missing key child3", result.contains("child3")); in test_getKeys() 56 Vector result = new Vector(); in test_handleGetObjectLjava_lang_String() local [all …]
|
/libcore/luni/src/main/native/ |
D | cbigint.cpp | 158 uint32_t * result) in simpleMultiplyAddHighPrecision() argument 171 HIGH_IN_U64 (product) + result[resultIndex] + in simpleMultiplyAddHighPrecision() 173 result[resultIndex] = LOW_U32_FROM_VAR (product); in simpleMultiplyAddHighPrecision() 176 HIGH_IN_U64 (product) + result[resultIndex] + in simpleMultiplyAddHighPrecision() 178 result[resultIndex] = LOW_U32_FROM_VAR (product); in simpleMultiplyAddHighPrecision() 183 result[resultIndex] += HIGH_U32_FROM_VAR (product); in simpleMultiplyAddHighPrecision() 184 if (result[resultIndex] < HIGH_U32_FROM_VAR (product)) in simpleMultiplyAddHighPrecision() 188 while (++result[resultIndex] == 0) in simpleMultiplyAddHighPrecision() 195 uint64_t * result, int32_t length) in multiplyHighPrecision() argument 212 memset (result, 0, sizeof (uint64_t) * length); in multiplyHighPrecision() [all …]
|