Home
last modified time | relevance | path

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

12

/libcore/luni/src/main/java/java/math/
DMultiplication.java127 return BigInteger.TEN.pow(intExp); in powerOf10()
135 res = bigFivePows[1].pow(intExp).shiftLeft(intExp); in powerOf10()
144 BigInteger powerOfFive = bigFivePows[1].pow(Integer.MAX_VALUE); in powerOf10()
153 res = res.multiply(bigFivePows[1].pow(intExp)); in powerOf10()
184 return val.multiply(bigFivePows[1].pow(exp)); in multiplyByFivePow()
DBigDecimal.java1618 public BigDecimal pow(int n) { in pow() method in BigDecimal
1628 : new BigDecimal(getUnscaledValue().pow(n), safeLongToInt(newScale)); in pow()
1643 public BigDecimal pow(int n, MathContext mc) { in pow() method in BigDecimal
1654 return pow(n); in pow()
/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 …]
DStrictMathTest.java535 .pow(10, 14))); in test_log10_D()
953 (long) StrictMath.pow(2, 8) == 256l); in test_powDD()
955 StrictMath.pow(2, -8) == 0.00390625d); in test_powDD()
1399 2, StrictMath.sqrt(StrictMath.pow(StrictMath.sqrt(2), 4)), 0.0); in test_sqrtD()
1500 assertEquals("Returned incorrect value", StrictMath.pow(2, 971), in test_ulp_D()
1502 assertEquals("Returned incorrect value", StrictMath.pow(2, 971), in test_ulp_D()
/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()
DBigIntegerTest.java46 BigInteger twoToTheSeventy = two.pow(70);
357 assertTrue("Incorrect exponent returned for 2**10", two.pow(10).equals( in test_powI()
359 assertTrue("Incorrect exponent returned for 2**70", two.pow(30) in test_powI()
360 .multiply(two.pow(40)).equals(twoToTheSeventy)); in test_powI()
361 assertTrue("Incorrect exponent returned for 10**50", ten.pow(50) in test_powI()
DOldBigIntegerTest.java53 assertTrue("Random number is too big", bi.compareTo(two.pow(70)) < 0); in test_ConstructorILjava_util_Random()
DBigDecimalArithmeticTest.java430 BigDecimal result = aNumber.pow(exp); in testPow()
445 BigDecimal result = aNumber.pow(exp); in testPow0()
456 BigDecimal result = BigDecimal.ZERO.pow(0); in testZeroPow0()
472 BigDecimal result = aNumber.pow(exp, mc); in testPowMathContext()
/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
Dfdlibm.h136 extern double pow __P((double, double));
DStrictMath.c172 NATIVE_METHOD(StrictMath, pow, "(DD)D"),
/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/annotations/mmodule/java/lang/
DMath.annotated.java73 public static native double pow(double a, double b); in pow() method in Math
/libcore/ojluni/src/main/java/java/lang/
DStrictMath.java632 public static native double pow(double a, double b); in pow() method in StrictMath
DMath.java640 public static native double pow(double a, double b); in pow() method in Math
/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestFractionPrinterParser.java289 int power = (int) Math.pow(10, (9 - maxWidth)); in fixParsedValue()
/libcore/benchmarks/src/benchmarks/regression/
DStrictMathBenchmark.java281 StrictMath.pow(d, d); in timePow()
DMathBenchmark.java341 result = Math.pow(d, d); in timePow()

12