/libcore/ojluni/src/test/java/math/BigDecimal/ |
D | DivideTests.java | 78 BigInteger b_prime = divisorIntvalue.divide(dividendIntvalue.gcd(divisorIntvalue)); in anotherDivide() 92 b_prime = b_prime.divide(TEN); in anotherDivide() 98 b_prime = b_prime.divide(FIVE); in anotherDivide() 107 b_prime = b_prime.divide(TWO); in anotherDivide() 135 return dividend.divide(divisor, mc); in anotherDivide() 152 bd = BigDecimal.ONE.divide(new BigDecimal(product=powerOf2*powerOf5)); in powersOf2and5() 159 bd = new BigDecimal(powerOf2).divide(new BigDecimal(powerOf5)); in powersOf2and5() 166 bd = new BigDecimal(powerOf5).divide(new BigDecimal(powerOf2)); in powersOf2and5() 194 divide(new BigDecimal(divisor))); in nonTerminating() 225 BigDecimal quotient = tc[0].divide(tc[1]); in properScaleTests() [all …]
|
D | ZeroScalingTests.java | 270 BigDecimal result = zero.divide(one); in divideTests() 276 result = zero.divide(one, MathContext.UNLIMITED); in divideTests() 282 result = zero.divide(one, longEnough); in divideTests()
|
D | SquareRootTests.java | 564 approx = ONE_HALF.multiply(approx.add(working.divide(approx, mcTmp), mcTmp)); 630 ulp = ulp.divide(TEN);
|
/libcore/luni/src/test/java/libcore/java/math/ |
D | OldBigDecimalArithmeticTest.java | 197 a.round(mc).divide(b.round(mc)).toString()); in testDivideINonTrivial() 198 res = a.divide(b, BigDecimal.ROUND_FLOOR); in testDivideINonTrivial() 203 res = a.divide(b, BigDecimal.ROUND_UNNECESSARY); in testDivideINonTrivial() 209 res = a.divide(b, BigDecimal.ROUND_UNNECESSARY); in testDivideINonTrivial() 223 res = a.divide(b, -1220, BigDecimal.ROUND_FLOOR); in testDivideIINonTrivial() 228 res = a.divide(b, 1, BigDecimal.ROUND_UNNECESSARY); in testDivideIINonTrivial() 234 res = a.divide(b, 0, BigDecimal.ROUND_UNNECESSARY); in testDivideIINonTrivial() 252 a.round(mc).divide(b.round(mc)).toString()); in testDivideScaleRoundingModeNonTrivial() 253 res = a.divide(b, mc); in testDivideScaleRoundingModeNonTrivial() 259 res = a.divide(b, mc); in testDivideScaleRoundingModeNonTrivial() [all …]
|
D | BigDecimalTest.java | 62 BigDecimal computed = parsed.divide(BigDecimal.ONE); in assertPrecision() 130 new BigDecimal(n).divide(new BigDecimal(d), scale, rm)); in checkDivide() 273 minLong.divide(new BigDecimal("-1"), /* scale = */ 0, RoundingMode.UNNECESSARY)); in testDivideAvoids64bitOverflow() 278 .divide(new BigDecimal("-0.1"), /* scale = */ 0, RoundingMode.UNNECESSARY)); in testDivideAvoids64bitOverflow() 283 … .divide(new BigDecimal("-1E+1"), /* scale = */ 0, RoundingMode.UNNECESSARY)); in testDivideAvoids64bitOverflow() 287 minLong.divide(new BigDecimal("-1E+1"), /* scale = */ 1, RoundingMode.UNNECESSARY)); in testDivideAvoids64bitOverflow() 293 minLong.divide(new BigDecimal("-1"), /* scale = */ 1, RoundingMode.UNNECESSARY)); in testDivideAvoids64bitOverflow() 297 minLong.divide(new BigDecimal("-1.0"), /* scale = */ 0, RoundingMode.UNNECESSARY)); in testDivideAvoids64bitOverflow() 301 minLong.divide(new BigDecimal("-1.0"), /* scale = */ 1, RoundingMode.UNNECESSARY)); in testDivideAvoids64bitOverflow() 307 new BigDecimal("-4611686018427387904").divide( in testDivideAvoids64bitOverflow() [all …]
|
D | BigIntegerTest.java | 194 BigInteger posV = negV.divide(BigInteger.valueOf(-1)); in test_divide_avoids64bitOverflow()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/ |
D | BigIntegerDivideTest.java | 42 aNumber.divide(bNumber); in testCase1() 57 aNumber.divide(bNumber); in testCase2() 74 BigInteger result = aNumber.divide(bNumber); in testCase3() 94 BigInteger result = aNumber.divide(bNumber); in testCase4() 115 BigInteger result = aNumber.divide(bNumber); in testCase5() 136 BigInteger result = aNumber.divide(bNumber); in testCase6() 156 BigInteger result = aNumber.divide(bNumber); in testCase7() 176 BigInteger result = aNumber.divide(bNumber); in testCase8() 196 BigInteger result = aNumber.divide(bNumber); in testCase9() 216 BigInteger result = aNumber.divide(bNumber); in testCase10() [all …]
|
D | BigDecimalArithmeticTest.java | 486 aNumber.divide(bNumber); in testDivideByZero() 504 aNumber.divide(bNumber, BigDecimal.ROUND_UNNECESSARY); in testDivideExceptionRM() 522 aNumber.divide(bNumber, 100); in testDivideExceptionInvalidRM() 541 BigDecimal result = aNumber.divide(bNumber, resScale, BigDecimal.ROUND_CEILING); in testDivideExpLessZero() 558 BigDecimal result = aNumber.divide(bNumber, resScale, BigDecimal.ROUND_CEILING); in testDivideExpEqualsZero() 575 BigDecimal result = aNumber.divide(bNumber, resScale, BigDecimal.ROUND_CEILING); in testDivideExpGreaterZero() 592 BigDecimal result = aNumber.divide(bNumber, resScale, BigDecimal.ROUND_CEILING); in testDivideRemainderIsZero() 609 BigDecimal result = aNumber.divide(bNumber, resScale, BigDecimal.ROUND_UP); in testDivideRoundUpNeg() 626 BigDecimal result = aNumber.divide(bNumber, resScale, BigDecimal.ROUND_UP); in testDivideRoundUpPos() 643 BigDecimal result = aNumber.divide(bNumber, resScale, BigDecimal.ROUND_DOWN); in testDivideRoundDownNeg() [all …]
|
D | BigIntegerHashCodeTest.java | 44 aNumber1.divide(aNumber2).bitLength(); in testSameObject()
|
D | BigDecimalTest.java | 220 BigDecimal divd3 = divd1.divide(divd2, BigDecimal.ROUND_UP); in test_divideLjava_math_BigDecimalI() 228 divd3 = divd1.divide(divd2, BigDecimal.ROUND_DOWN); in test_divideLjava_math_BigDecimalI() 235 divd1.divide(divd2, BigDecimal.ROUND_DOWN); in test_divideLjava_math_BigDecimalI() 247 BigDecimal divd3 = divd1.divide(divd2, 3, BigDecimal.ROUND_HALF_UP); in test_divideLjava_math_BigDecimalII() 252 divd3 = divd1.divide(divd2, 0, BigDecimal.ROUND_DOWN); in test_divideLjava_math_BigDecimalII() 259 divd1.divide(divd2, 4, BigDecimal.ROUND_DOWN); in test_divideLjava_math_BigDecimalII()
|
D | BigIntegerTest.java | 451 assertTrue(">>1 == /2", d.divide(two).equals(c)); in test_shiftRightI() 457 assertTrue(">>1 == /2", f.subtract(one).divide(two).equals(e)); in test_shiftRightI() 567 largePos.divide(zero); in test_divideLjava_math_BigInteger() 573 bi1.divide(zero); in test_divideLjava_math_BigInteger() 579 bi3.negate().divide(zero); in test_divideLjava_math_BigInteger() 585 zero.divide(zero); in test_divideLjava_math_BigInteger() 899 BigInteger q = i1.divide(i2); in testDiv()
|
/libcore/benchmarks/src/benchmarks/ |
D | BigIntegerBenchmark.java | 81 sum = sum.add(scaledOne.divide(BigInteger.valueOf(i))); in harmonic1000() 129 return tmp.multiply(base).divide(scaleBy); in myPow() 132 return tmp.multiply(tmp).divide(scaleBy); in myPow() 141 BigInteger base = scaledOne.add(scaledOne.divide(BigInteger.valueOf(n))); in eApprox()
|
/libcore/ojluni/src/main/java/java/math/ |
D | BigDecimal.java | 1654 public BigDecimal divide(BigDecimal divisor, int scale, int roundingMode) { in divide() method in BigDecimal 1659 …return divide(this.intCompact, this.scale, divisor.intCompact, divisor.scale, scale, roundingMode); in divide() 1661 … return divide(this.intCompact, this.scale, divisor.intVal, divisor.scale, scale, roundingMode); in divide() 1665 … return divide(this.intVal, this.scale, divisor.intCompact, divisor.scale, scale, roundingMode); in divide() 1667 … return divide(this.intVal, this.scale, divisor.intVal, divisor.scale, scale, roundingMode); in divide() 1688 public BigDecimal divide(BigDecimal divisor, int scale, RoundingMode roundingMode) { in divide() method in BigDecimal 1689 return divide(divisor, scale, roundingMode.oldMode); in divide() 1720 public BigDecimal divide(BigDecimal divisor, int roundingMode) { in divide() method in BigDecimal 1721 return this.divide(divisor, scale, roundingMode); in divide() 1739 public BigDecimal divide(BigDecimal divisor, RoundingMode roundingMode) { in divide() method in BigDecimal [all …]
|
D | MutableBigInteger.java | 1151 MutableBigInteger divide(MutableBigInteger b, MutableBigInteger quotient) { in divide() method in MutableBigInteger 1152 return divide(b,quotient,true); in divide() 1155 … MutableBigInteger divide(MutableBigInteger b, MutableBigInteger quotient, boolean needRemainder) { in divide() method in MutableBigInteger 1443 long divide(long v, MutableBigInteger quotient) { in divide() method in MutableBigInteger 1947 this.divide(xk, xk1, false); 1977 MutableBigInteger r = a.divide(b, q); 2114 return result.divide(p, temp1); 2242 MutableBigInteger remainder = c.divide(p, 2291 c = c.divide(p, new MutableBigInteger()); 2307 MutableBigInteger r = b.divide(a, q); [all …]
|
/libcore/ojluni/src/test/java/math/BigInteger/ |
D | OperatorNpeTests.java | 55 result = bd.divide(null); in testOperatorsNpe()
|
D | BigIntegerTest.java | 362 BigInteger baz = x.divide(y); in arithmetic() 642 BigInteger z = x.divide(BigInteger.valueOf(2L)); in divideAndRemainder()
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | BigIntegerBenchmark.java | 28 x.divide(y); in timeRandomDivision()
|
/libcore/ojluni/src/test/java/lang/Double/ |
D | ParseDoubleTest.java | 99 bd = bd.divide(BigDecimal.valueOf(2).pow((int)-exp)); in check() 678 BigDecimal lowerBound = d_BD.subtract(ulp_BD.divide(TWO)); in testSubnormalPowers() 679 BigDecimal upperBound = d_BD.add(ulp_BD.divide(TWO)); in testSubnormalPowers()
|
/libcore/ojluni/src/test/java/lang/Math/ |
D | DivModTests.java | 259 BigDecimal resultD = xD.divide(yD, RoundingMode.FLOOR); in testLongFloorMod() 368 BigDecimal resultD = xD.divide(yD, RoundingMode.FLOOR); in testLongIntFloorMod() 738 BigDecimal resultD = xD.divide(yD, RoundingMode.CEILING); in testLongCeilMod() 847 BigDecimal resultD = xD.divide(yD, RoundingMode.CEILING); in testLongIntCeilMod()
|
D | ExactArithTests.java | 150 q = BigInteger.valueOf(x).divide(BigInteger.valueOf(y)); in testIntegerExact() 394 resultBig = xBig.divide(yBig); in testLongExact()
|
/libcore/ojluni/src/test/java/lang/Long/ |
D | Unsigned.java | 322 BigInteger quotient = maxUnsignedLong.divide(BigInteger.valueOf(radix)); in testParseUnsignedLong() 394 longQuotient = dividend.divide(divisor); in testDivideAndRemainder()
|
/libcore/ojluni/src/test/java/lang/Float/ |
D | ParseFloatTest.java | 97 bd = bd.divide(BigDecimal.valueOf(2).pow((int)-exp)); in check()
|
/libcore/ojluni/annotations/sdk/nullability/java/math/ |
D | BigInteger.annotated.java | 69 …@libcore.util.NonNull public BigInteger divide(@libcore.util.NonNull BigInteger val) { throw new R… in divide() method in BigInteger
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | LongTest.java | 193 assertEquals(dividend.divide(divisor).longValue(), uq);
|
/libcore/ojluni/src/main/java/java/time/ |
D | Duration.java | 979 return create(toBigDecimalSeconds().divide(BigDecimal.valueOf(divisor), RoundingMode.DOWN)); in dividedBy()
|