Home
last modified time | relevance | path

Searched refs:multiply (Results 1 – 25 of 43) sorted by relevance

12

/libcore/ojluni/src/test/java/math/BigInteger/
DLargeValueExceptions.java73 BigInteger y = x.multiply(x); in squareNoOverflow()
80 BigInteger y = x.multiply(x); in squareIndefiniteOverflowSuccess()
87 BigInteger y = x.multiply(x); in squareIndefiniteOverflowFailure()
97 BigInteger y = x.multiply(x); in squareDefiniteOverflow()
109 BigInteger z = x.multiply(y); in multiplyNoOverflow()
125 BigInteger z = x.multiply(y); in multiplyIndefiniteOverflowSuccess()
141 BigInteger z = x.multiply(y); in multiplyIndefiniteOverflowFailure()
159 BigInteger z = x.multiply(y); in multiplyDefiniteOverflow()
DBigIntegerTest.java224 z = z.multiply(x); in pow()
234 BigInteger xx = x.multiply(x); in square()
287 Assert.assertFalse(s.multiply(s).compareTo(n) > 0, in squareRoot()
363 baz = baz.multiply(y); in arithmetic()
382 baz[0] = baz[0].multiply(y); in arithmetic()
420 BigInteger multiplyResult = u.multiply(v).shiftLeft(a + b); in multiplyLarge()
421 BigInteger karatsubaMultiplyResult = w.multiply(z); in multiplyLarge()
435 BigInteger multiplyResult = u.multiply(v).shiftLeft(2); in multiplyLarge()
436 BigInteger toomCookMultiplyResult = u2.multiply(v2); in multiplyLarge()
458 BigInteger squareResult = u.multiply(u).shiftLeft(2*a); in squareLarge()
[all …]
DPrimeTest.java130 BigInteger left = p.multiply(fourToTheC); in checkPrime()
131 BigInteger right = t.multiply(fourToTheCMinusOne); in checkPrime()
DOperatorNpeTests.java48 result = bd.multiply(null); in testOperatorsNpe()
DBitLengthOverflow.java64 return a.multiply(b); in main()
DModInvTime.java53 BigInteger r = inv.multiply(val).remainder(mod); in check()
/libcore/ojluni/src/test/java/lang/Double/
DParseDoubleTest.java97 bd = bd.multiply(BigDecimal.valueOf(2).pow((int)exp)); in check()
106 … = new BigDecimal(Double.MAX_VALUE).add(new BigDecimal(Math.ulp(Double.MAX_VALUE)).multiply(HALF)); in check()
109 … l = new BigDecimal(na).subtract(new BigDecimal(Math.ulp(Math.nextUp(-na))).multiply(HALF)); in check()
110 u = new BigDecimal(na).add(new BigDecimal(Math.ulp(n)).multiply(HALF)); in check()
695 … Assert.assertEquals(Double.parseDouble(minValue.multiply(new BigDecimal(0.5)).toString()), 0.0, in testSubnormalPowers()
697 …Assert.assertEquals(Double.parseDouble(minValue.multiply(new BigDecimal(0.50000000001)).toString()… in testSubnormalPowers()
699 …Assert.assertEquals(Double.parseDouble(minValue.multiply(new BigDecimal(1.49999999999)).toString()… in testSubnormalPowers()
701 …Assert.assertEquals(Double.parseDouble(minValue.multiply(new BigDecimal(1.5)).toString()), 2*Doubl… in testSubnormalPowers()
715 … BigDecimal lowerBound = d_BD.subtract(new BigDecimal(Math.ulp(Math.nextUp(-d))).multiply(HALF)); in testPowers()
716 BigDecimal upperBound = d_BD.add(new BigDecimal(Math.ulp(d)).multiply(HALF)); in testPowers()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigIntegerMultiplyTest.java42 BigInteger result = aNumber.multiply(bNumber); in testCase1()
63 BigInteger result = aNumber.multiply(bNumber); in testCase2()
85 BigInteger result = aNumber.multiply(bNumber); in testCase3()
107 BigInteger result = aNumber.multiply(bNumber); in testCase4()
130 BigInteger result = aNumber.multiply(bNumber); in testCase5()
153 BigInteger result = aNumber.multiply(bNumber); in testCase6()
173 BigInteger result = aNumber.multiply(bNumber); in testCase7()
191 BigInteger result = aNumber.multiply(bNumber); in testCase8()
209 BigInteger result = aNumber.multiply(bNumber); in testCase9()
227 BigInteger result = aNumber.multiply(bNumber); in testCase10()
[all …]
DBigIntegerTest.java190 bi = BigInteger.valueOf(rand.nextInt(1000000)).multiply( in test_isProbablePrimeI()
198 bi = new BigInteger(70, rand).multiply(new BigInteger(70, rand)); in test_isProbablePrimeI()
355 .multiply(two.pow(40)).equals(twoToTheSeventy)); in test_powI()
372 + " equals " + inv, one.equals(a.multiply(inv).mod( in test_modInverseLjava_math_BigInteger()
393 + " equals " + inv, one.equals(a.multiply(inv).mod( in test_modInverseLjava_math_BigInteger()
494 assertTrue("<<1 == *2", b.multiply(two).equals(a)); in test_shiftLeftI()
501 assertTrue("<<1 == *2 negative", d.multiply(two).equals(c)); in test_shiftLeftI()
513 aZillion.multiply(new BigInteger("3", 10)))); in test_multiplyLjava_math_BigInteger()
515 assertTrue("0*0", zero.multiply(zero).equals(zero)); in test_multiplyLjava_math_BigInteger()
516 assertTrue("0*1", zero.multiply(one).equals(zero)); in test_multiplyLjava_math_BigInteger()
[all …]
DOldBigIntegerTest.java147 bi = BigInteger.valueOf(rand.nextInt(1000000)).multiply( in test_isProbablePrimeI()
155 bi = new BigInteger(70, rand).multiply(new BigInteger(70, rand)); in test_isProbablePrimeI()
179 BigInteger c = a.multiply(b); in test_isProbablePrimeI()
205 BigInteger wp = a.multiply(b); in largePrimesProduct()
DBigIntegerHashCodeTest.java43 aNumber1.multiply(aNumber2).toByteArray(); in testSameObject()
/libcore/ojluni/src/test/java/lang/Float/
DParseFloatTest.java95 bd = bd.multiply(BigDecimal.valueOf(2).pow((int)exp)); in check()
104 … l = new BigDecimal(Float.MAX_VALUE).add(new BigDecimal(Math.ulp(Float.MAX_VALUE)).multiply(HALF)); in check()
107 … l = new BigDecimal(na).subtract(new BigDecimal(Math.ulp(-Math.nextUp(-na))).multiply(HALF)); in check()
108 u = new BigDecimal(na).add(new BigDecimal(Math.ulp(n)).multiply(HALF)); in check()
316 … BigDecimal lowerBound = f_BD.subtract(new BigDecimal(Math.ulp(-Math.nextUp(-f))).multiply(HALF)); in testPowers()
317 BigDecimal upperBound = f_BD.add(new BigDecimal(Math.ulp(f)).multiply(HALF)); in testPowers()
322 …gDecimal(Float.MAX_VALUE).add(new BigDecimal(Math.ulp(Float.MAX_VALUE)).multiply(HALF)).toString()… in testPowers()
/libcore/ojluni/src/test/java/math/BigDecimal/
DMultiplyTests.java74 Assert.assertEquals(bd1[i].multiply(bd2[j]), expectedResults[i][j], in multiplyTests()
75 bd1[i] + " * " + bd2[j] + " + is " + bd1[i].multiply(bd2[j]) + in multiplyTests()
84 xPower = xPower.multiply(x); in multiplyTests()
DPrecisionTests.java57 testValues[0] = testValues[0].multiply(TEN); in testPrecision()
58 testValues[1] = testValues[1].multiply(TEN).add(NINE); in testPrecision()
DSquareRootTests.java104 bd = bd.multiply(ONE_TENTH); in oneDigitTests()
129 BigDecimal bd1 = bd0.multiply(ONE_TENTH); in twoDigitTests()
130 BigDecimal bd2 = bd1.multiply(ONE_TENTH); in twoDigitTests()
303 BigDecimal near10sq = near10.multiply(near10);
328 BigDecimal near1sq = near1.multiply(near1);
366 BigDecimal square = halfWayCase.multiply(halfWayCase);
423 return bd.multiply(bd);
564 approx = ONE_HALF.multiply(approx.add(working.divide(approx, mcTmp), mcTmp));
DZeroScalingTests.java232 BigDecimal result = zero1.multiply(value); in multiplyTests()
239 result = zero1.multiply(value, MathContext.UNLIMITED); in multiplyTests()
245 result = zero1.multiply(value, longEnough); in multiplyTests()
/libcore/luni/src/test/java/libcore/java/math/
DBigDecimalTest.java76 BigDecimal b = a.multiply(BigDecimal.ONE); in testPrecisionFromString()
334 assertEquals(bigValue, bigHalfValue.multiply(two)); in checkCommonOperations()
369 valueOf(a).multiply(valueOf(b)).toString()); in checkMultiply_consistentWithLong()
373 assertEquals(valueOf(expectedResult, 5), valueOf(a, 2).multiply(valueOf(b, 3))); in checkMultiply_consistentWithLong()
379 valueOf(-(1L << 62L), 2).multiply(valueOf(-2, 1)).toString()); in testMultiply_near64BitOverflow_scaled()
383 valueOf(-(1L << 62L), 2).multiply(valueOf(2, 1)).toString()); in testMultiply_near64BitOverflow_scaled()
387 valueOf(-(1L << 62L), -2).multiply(valueOf(-2, 1))); in testMultiply_near64BitOverflow_scaled()
419 BigDecimal result = bigA.multiply(bigB); in bigMultiply()
420 assertEquals("Multiplication should be commutative", result, bigB.multiply(bigA)); in bigMultiply()
/libcore/ojluni/src/test/java/lang/Math/
DMultiplicationTests.java52 return BigInteger.valueOf(x).multiply(BigInteger.valueOf(y)) in multiplyHighBigInt()
72 BiFunction<Long,Long,Long> multiply, long x, long y) { in check() argument
74 long p2 = multiply.apply(x, y); in check()
/libcore/benchmarks/src/benchmarks/
DBigIntegerBenchmark.java57 sum = sum.add(big.multiply(big)); in inner()
129 return tmp.multiply(base).divide(scaleBy); in myPow()
132 return tmp.multiply(tmp).divide(scaleBy); in myPow()
167 BigInteger product = odd1.multiply(odd2); in repeatModPow()
195 BigInteger product = odd1.multiply(odd2); in repeatModInverse()
DSmallBigIntegerBenchmark.java49 x = x.multiply(BIG_THREE).add(BigInteger.ONE); in main()
/libcore/luni/src/main/java/javax/xml/datatype/
DDuration.java633 public Duration multiply(int factor) { in multiply() method in Duration
634 return multiply(BigDecimal.valueOf(factor)); in multiply()
684 public abstract Duration multiply(final BigDecimal factor); in multiply() method in Duration
/libcore/ojluni/src/main/java/java/math/
DBigDecimal.java1030 rb = BigInteger.valueOf(5).pow(-exponent).multiply(compactVal); in BigDecimal()
1033 rb = BigInteger.TWO.pow(exponent).multiply(compactVal); in BigDecimal()
1580 public BigDecimal multiply(BigDecimal multiplicand) { in multiply() method in BigDecimal
1584 return multiply(this.intCompact, multiplicand.intCompact, productScale); in multiply()
1586 return multiply(this.intCompact, multiplicand.intVal, productScale); in multiply()
1590 return multiply(multiplicand.intCompact, this.intVal, productScale); in multiply()
1592 return multiply(this.intVal, multiplicand.intVal, productScale); in multiply()
1606 public BigDecimal multiply(BigDecimal multiplicand, MathContext mc) { in multiply() method in BigDecimal
1608 return multiply(multiplicand); in multiply()
1949 BigDecimal product = result.multiply(divisor); in divideToIntegralValue()
[all …]
DBigInteger.java1067 u2 = u.multiply(v).mod(n);
1069 v2 = v.square().add(d.multiply(u.square())).mod(n);
1082 v2 = v.add(d.multiply(u)).mod(n);
1582 public BigInteger multiply(BigInteger val) { in multiply() method
1583 return multiply(val, false); in multiply()
1594 private BigInteger multiply(BigInteger val, boolean isRecursion) { in multiply() method
1760 BigInteger multiply(long v) { in multiply() method
1764 return multiply(BigInteger.valueOf(v)); in multiply()
2628 answer = answer.multiply(partToSquare); in pow()
2947 result = a1.multiply(m2).multiply(y1).add(a2.multiply(m1).multiply(y2)).mod(m); in modPow()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DBigIntegerBenchmark.java46 x.multiply(y); in timeRandomMultiplication()
/libcore/ojluni/src/test/java/lang/StrictMath/
DMultiplicationTests.java62 return BigInteger.valueOf(x).multiply(BigInteger.valueOf(y)) in multiplyHighBigInt()

12