Home
last modified time | relevance | path

Searched refs:pow (Results 1 – 25 of 52) sorted by relevance

123

/libcore/ojluni/src/test/java/util/Arrays/
DTimSortStackSize.java101 int pow = MIN; in genData() local
102 while (pow < total) { in genData()
103 pow += pow; in genData()
105 chunks.addLast(pow - total); in genData()
107 Integer[] array = new Integer[pow]; in genData()
/libcore/ojluni/src/test/java/lang/Math/
DPowTests.java44 StrictMath.pow(input1, input2), expected); in testPowCase()
60 Math.pow(input1, input2), strictMathExpected); in testPowCase()
67 StrictMath.pow(input1, input2), expected); in testStrictPowCase()
72 Math.pow(input1, input2), expected); in testNonstrictPowCase()
248 return StrictMath.pow(Math.abs(x), y); in f3()
252 return -StrictMath.pow(Math.abs(x), y); in f3()
268 return Math.pow(Math.abs(x), y); in f3ns()
272 return -Math.pow(Math.abs(x), y); in f3ns()
DCubeRootTests.java182 err = d - StrictMath.pow(y1, 3); in testCubeRoot()
189 err_adjacent = StrictMath.pow(Math.nextUp(y1), 3) - d; in testCubeRoot()
191 err_adjacent = StrictMath.pow(Math.nextAfter(y1, 0.0), 3) - d; in testCubeRoot()
201 err = d - StrictMath.pow(y2, 3); in testCubeRoot()
208 err_adjacent = StrictMath.pow(Math.nextUp(y2), 3) - d; in testCubeRoot()
210 err_adjacent = StrictMath.pow(Math.nextAfter(y2, 0.0), 3) - d; in testCubeRoot()
/libcore/benchmarks/src/benchmarks/
DBigIntegerBenchmark.java54 BigInteger big = BigInteger.TEN.pow(prec).shiftLeft(30).add(BigInteger.ONE); in inner()
78 BigInteger scaledOne = BigInteger.TEN.pow(prec); in harmonic1000()
140 BigInteger scaledOne = BigInteger.TEN.pow(prec); in eApprox()
165 BigInteger odd1 = BigInteger.TEN.pow(len / 2).add(BigInteger.ONE); in repeatModPow()
166 BigInteger odd2 = BigInteger.TEN.pow(len / 2).add(BigInteger.valueOf(17)); in repeatModPow()
168 BigInteger exponent = BigInteger.TEN.pow(len / 2 - 1); in repeatModPow()
169 BigInteger base = BigInteger.TEN.pow(len / 4); in repeatModPow()
193 BigInteger odd1 = BigInteger.TEN.pow(len / 2).add(BigInteger.ONE); in repeatModInverse()
194 BigInteger odd2 = BigInteger.TEN.pow(len / 2).add(BigInteger.valueOf(17)); in repeatModInverse()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DMathTest.java570 assertEquals(14.0, Math.log10(Math.pow(10, 14))); in test_log10_D()
1153 + ",-0.0)=+1.0", 1.0, Math.pow(dval, NZERO)); in test_powDD()
1155 + ",-0.0)=+1.0", 1.0, Math.pow(negateDval, NZERO)); in test_powDD()
1157 + ",+0.0)=+1.0", 1.0, Math.pow(dval, +0.0)); in test_powDD()
1159 + ",+0.0)=+1.0", 1.0, Math.pow(negateDval, +0.0)); in test_powDD()
1164 + dval, dval, Math.pow(dval, 1.0)); in test_powDD()
1166 + ")=" + negateDval, negateDval, Math.pow(negateDval, 1.0)); in test_powDD()
1174 + ")=" + answer, answer, Math.pow(dval, Double.NaN)); in test_powDD()
1179 + Double.NaN + ")=" + Double.NaN, Double.NaN, Math.pow(negateDval, in test_powDD()
1187 + dval + ")=" + Double.NaN, Double.NaN, Math.pow(Double.NaN, dval)); in test_powDD()
[all …]
/libcore/ojluni/src/test/java/math/BigDecimal/
DEqualsTests.java62 {valueOf(Math.round(Math.pow(2, 10))), new BigDecimal("1024")}, in testEquals()
63 {new BigDecimal("1020"), valueOf(Math.pow(2, 11))}, in testEquals()
65 {new BigDecimal(BigInteger.valueOf(2).pow(65)), in testEquals()
DPowTests.java68 result = testCase[0].pow(exponent); in zeroAndOneTests()
/libcore/ojluni/src/test/java/math/BigInteger/
DLargeValueExceptions.java166 BigInteger.TEN.pow(Integer.MAX_VALUE); in powOverflow()
174 BigInteger y = x.pow(exponent); in powOverflow1()
182 BigInteger y = x.pow(exponent); in powOverflow2()
190 BigInteger y = x.pow(exponent); in powOverflow3()
198 BigInteger y = x.pow(exponent); in powOverflow4()
DBigIntegerTest.java215 private static void pow(int order) { in pow() method in BigIntegerTest
220 BigInteger y = x.pow(power); in pow()
235 BigInteger x2 = x.pow(2); in square()
274 BigInteger n2 = n.pow(2); in squareRoot()
282 BigInteger up = n.add(BigInteger.ONE).pow(2).subtract(BigInteger.ONE); in squareRoot()
291 Assert.assertFalse(s.add(BigInteger.ONE).pow(2).compareTo(n) <= 0, in squareRoot()
323 BigInteger n2 = n.pow(2); in squareRootAndRemainder()
337 BigInteger up = n.add(BigInteger.ONE).pow(2).subtract(BigInteger.ONE); in squareRootAndRemainder()
622 Assert.assertEquals(x.shiftLeft(n), x.multiply(BigInteger.valueOf(2L).pow(n))); in shift()
624 BigInteger y[] =x.divideAndRemainder(BigInteger.valueOf(2L).pow(n)); in shift()
[all …]
DModPow.java58 BigInteger w = base.pow(exp.intValue()).mod(m); in testModPow()
/libcore/luni/src/test/resources/
Dmath_java_only.csv533 pow,NaN,-0x1.3543856880754p-1,0x1.35716fc87723bp0
534 pow,0x1.1d4a986c89024p0,0x1.43ced9e886399p-3,-0x1.e126d87d20ed6p-5
535 pow,0x1.522cbcdf959dep1,0x1.3c7d675466f15p-1,-0x1.0284cd3f0c777p1
536 pow,0x1.b9bb1a3e302d4p4,0x1.5b6d1c408c6b9p-3,-0x1.decec1eac9a7cp0
537 pow,0x1.73657e5443b04p15,0x1.b14dd1bdae0bp2,0x1.685fb1288c6ebp2
538 pow,0x1.42aabebdcc329p-3,0x1.dbac3718db8c6p2,-0x1.d7b5616fb60a8p-1
539 pow,NaN,-0x1.02396705ce823p1,-0x1.8534721a7fab8p-1
540 pow,0x1.0d1bfde3040d9p0,0x1.0bcf497703256p0,0x1.1b7acc031c2b8p0
541 pow,NaN,-0x1.673a84a184115p-1,0x1.da2090fb36b4ap0
542 pow,NaN,-0x1.0acacaef8fc6ap0,-0x1.608b00fd22779p-1
[all …]
/libcore/luni/src/test/java/libcore/java/math/
DOldBigDecimalArithmeticTest.java98 res = a.pow(-1); in testPowNonTrivial()
104 res = a.pow(-103); in testPowNonTrivial()
119 BigDecimal result = aNumber.pow(exp, mc); in testPowMathContext()
131 a.round(mc).pow(1000).round(mc).toString()); in testPowMathContextNonTrivial()
132 res = a.pow(1000, mc); in testPowMathContextNonTrivial()
138 a.round(mc).pow(1000).round(mc).toString()); in testPowMathContextNonTrivial()
139 res = a.pow(1000, mc); in testPowMathContextNonTrivial()
145 res = a.pow(-2, mc); in testPowMathContextNonTrivial()
153 res = a.pow(-2, mc); in testPowMathContextNonTrivial()
159 res = a.pow(-1, mc); in testPowMathContextNonTrivial()
[all …]
DOldBigDecimalTest.java41 big = new BigDecimal(Math.pow(2, -33)); in test_ConstructorD()
44 big = new BigDecimal(123456 * Math.pow(2, -33)); in test_ConstructorD()
47 big = new BigDecimal(-123456 * Math.pow(2, -33)); in test_ConstructorD()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigIntegerMultiplyTest.java285 aNumber.pow(exp); in testPowException()
303 BigInteger result = aNumber.pow(exp); in testPowNegativeNumToOddExp()
323 BigInteger result = aNumber.pow(exp); in testPowNegativeNumToEvenExp()
341 BigInteger result = aNumber.pow(exp); in testPowNegativeNumToZeroExp()
362 BigInteger result = aNumber.pow(exp); in testPowPositiveNum()
380 BigInteger result = aNumber.pow(exp); in testPowPositiveNumToZeroExp()
DBigIntegerHashCodeTest.java45 aNumber1.gcd(aNumber2).pow(7); in testSameObject()
/libcore/ojluni/src/main/native/
DMath.c91 return pow(d1, d2); in Math_pow()
161 FAST_NATIVE_METHOD(Math, pow, "(DD)D"),
Djfdlibm.h46 #define pow jpow macro
/libcore/luni/src/main/native/
Djava_lang_StringToReal.cpp216 result = toDoubleHighPrecision (f, length) * pow (10.0, e); in createDouble1()
240 result = toDoubleHighPrecision (f, length) / pow (10.0, -e); in createDouble1()
246 result = toDoubleHighPrecision (f, length) * pow (10.0, e + 52); in createDouble1()
247 result = result * pow (10.0, -52); in createDouble1()
601 result = (jfloat) (toDoubleHighPrecision (f, length) * pow (10.0, (double) e)); in createFloat1()
621 dresult = toDoubleHighPrecision (f, length) / pow (10.0, (double) -e); in createFloat1()
/libcore/luni/src/test/java/libcore/java/lang/
DOldAndroidStrictMathTest.java300 .pow(10, 14))); in testLog10D()
428 (long) StrictMath.pow(2, 8) == 256l); in testPowDD()
430 StrictMath.pow(2, -8) == 0.00390625d); in testPowDD()
543 2, StrictMath.sqrt(StrictMath.pow(StrictMath.sqrt(2), 4)), 0.0); in testSqrtD()
626 assertEquals("Returned incorrect value", StrictMath.pow(2, 971), in testUlp_D()
628 assertEquals("Returned incorrect value", StrictMath.pow(2, 971), in testUlp_D()
DOldAndroidMathTest.java335 assertEquals(14.0, Math.log10(Math.pow(10, 14))); in testLog10D()
451 (long) Math.pow(2, 8) == 256l); in testPowDD()
453 Math.pow(2, -8) == 0.00390625d); in testPowDD()
455 2, Math.sqrt(Math.pow(Math.sqrt(2), 4)), 0); in testPowDD()
642 assertEquals("Returned incorrect value", Math.pow(2, 971), Math in testUlpD()
644 assertEquals("Returned incorrect value", Math.pow(2, 971), Math in testUlpD()
/libcore/ojluni/src/test/java/text/Format/MessageFormat/
DBug7003643.java46 int max = (int) (Math.pow((double)elements.length, (double)N)/0.52); in main()
/libcore/ojluni/src/test/java/lang/Float/
DParseFloatTest.java95 bd = bd.multiply(BigDecimal.valueOf(2).pow((int)exp)); in check()
97 bd = bd.divide(BigDecimal.valueOf(2).pow((int)-exp)); in check()
/libcore/ojluni/src/test/java/lang/Long/
DUnsigned.java253 TWO.pow(64).subtract(BigInteger.ONE) in testParseUnsignedLong()
288 TWO.pow(64).toString(), in testParseUnsignedLong()
367 TWO.pow(64).subtract(BigInteger.ONE) in testDivideAndRemainder()
/libcore/ojluni/src/test/java/lang/StrictMath/
DPowTests.java279 StrictMath.pow(input1, input2), expected); in testPowCase()
/libcore/luni/src/test/java/libcore/java/util/
DArbitrarilyJumpableGeneratorTest.java65 state += Math.pow(2, logDistance); in jumpPowerOfTwo()

123