花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 b.java 源代码,内容仅作参考
package e.e.b.g;
import com.google.common.base.h0;
import com.kuaishou.weapon.p0.t;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
@e.e.b.a.b(emulated = true)
@e
public final class b {
@e.e.b.a.d
static final int a = 256;
@e.e.b.a.d
static final BigInteger b = new BigInteger("16a09e667f3bcc908b2fb1366ea957d3e3adec17512775099da2f590b0667322a", 16);
private static final double c = Math.log(10.0d);
private static final double f14159d = Math.log(2.0d);
public static class a {
static final int[] a;
static {
int[] iArr = new int[RoundingMode.values().length];
a = iArr;
try {
iArr[RoundingMode.UNNECESSARY.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[RoundingMode.DOWN.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[RoundingMode.FLOOR.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[RoundingMode.UP.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[RoundingMode.CEILING.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[RoundingMode.HALF_DOWN.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[RoundingMode.HALF_UP.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[RoundingMode.HALF_EVEN.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
}
}
@e.e.b.a.c
private static class C0876b extends p<BigInteger> {
static final C0876b a = new C0876b();
private C0876b() {
}
@Override
public BigInteger a(BigInteger bigInteger, BigInteger bigInteger2) {
return bigInteger.subtract(bigInteger2);
}
@Override
public double c(BigInteger bigInteger) {
return d.a(bigInteger);
}
@Override
public int d(BigInteger bigInteger) {
return bigInteger.signum();
}
@Override
public BigInteger e(double d2, RoundingMode roundingMode) {
return c.o(d2, roundingMode);
}
}
private b() {
}
public static BigInteger a(int i2, int i3) {
int i4;
i.e("n", i2);
i.e(t.a, i3);
int i5 = 1;
h0.m(i3 <= i2, "k (%s) > n (%s)", i3, i2);
if (i3 > (i2 >> 1)) {
i3 = i2 - i3;
}
int[] iArr = h.f14177h;
if (i3 < iArr.length && i2 <= iArr[i3]) {
return BigInteger.valueOf(h.a(i2, i3));
}
BigInteger bigInteger = BigInteger.ONE;
long j = i2;
long j2 = 1;
int q = h.q(j, RoundingMode.CEILING);
while (true) {
int i6 = q;
while (i5 < i3) {
i4 = i2 - i5;
i5++;
i6 += q;
if (i6 >= 63) {
break;
}
j *= i4;
j2 *= i5;
}
return bigInteger.multiply(BigInteger.valueOf(j)).divide(BigInteger.valueOf(j2));
bigInteger = bigInteger.multiply(BigInteger.valueOf(j)).divide(BigInteger.valueOf(j2));
j = i4;
j2 = i5;
}
}
@e.e.b.a.a
public static BigInteger b(BigInteger bigInteger) {
return BigInteger.ZERO.setBit(k(bigInteger, RoundingMode.CEILING));
}
@e.e.b.a.c
public static BigInteger c(BigInteger bigInteger, BigInteger bigInteger2, RoundingMode roundingMode) {
return new BigDecimal(bigInteger).divide(new BigDecimal(bigInteger2), 0, roundingMode).toBigIntegerExact();
}
public static BigInteger d(int i2) {
i.e("n", i2);
long[] jArr = h.f14176g;
if (i2 < jArr.length) {
return BigInteger.valueOf(jArr[i2]);
}
ArrayList arrayList = new ArrayList(f.g(f.p(i2, RoundingMode.CEILING) * i2, 64, RoundingMode.CEILING));
long[] jArr2 = h.f14176g;
int length = jArr2.length;
long j = jArr2[length - 1];
int numberOfTrailingZeros = Long.numberOfTrailingZeros(j);
long j2 = j >> numberOfTrailingZeros;
int q = h.q(j2, RoundingMode.FLOOR) + 1;
long j3 = length;
int q2 = h.q(j3, RoundingMode.FLOOR) + 1;
int i3 = 1 << (q2 - 1);
while (j3 <= i2) {
if ((i3 & j3) != 0) {
i3 <<= 1;
q2++;
}
int numberOfTrailingZeros2 = Long.numberOfTrailingZeros(j3);
long j4 = j3 >> numberOfTrailingZeros2;
numberOfTrailingZeros += numberOfTrailingZeros2;
if ((q2 - numberOfTrailingZeros2) + q >= 64) {
arrayList.add(BigInteger.valueOf(j2));
j2 = 1;
}
j2 *= j4;
q = h.q(j2, RoundingMode.FLOOR) + 1;
j3++;
}
if (j2 > 1) {
arrayList.add(BigInteger.valueOf(j2));
}
return h(arrayList).shiftLeft(numberOfTrailingZeros);
}
@e.e.b.a.c
static boolean e(BigInteger bigInteger) {
return bigInteger.bitLength() <= 63;
}
@e.e.b.a.a
public static BigInteger f(BigInteger bigInteger) {
return BigInteger.ZERO.setBit(k(bigInteger, RoundingMode.FLOOR));
}
public static boolean g(BigInteger bigInteger) {
h0.E(bigInteger);
return bigInteger.signum() > 0 && bigInteger.getLowestSetBit() == bigInteger.bitLength() - 1;
}
static BigInteger h(List<BigInteger> list) {
return i(list, 0, list.size());
}
static BigInteger i(List<BigInteger> list, int i2, int i3) {
int i4 = i3 - i2;
if (i4 != 0) {
if (i4 != 1) {
if (i4 != 2) {
if (i4 != 3) {
int i5 = (i3 + i2) >>> 1;
return i(list, i2, i5).multiply(i(list, i5, i3));
}
return list.get(i2).multiply(list.get(i2 + 1)).multiply(list.get(i2 + 2));
}
return list.get(i2).multiply(list.get(i2 + 1));
}
return list.get(i2);
}
return BigInteger.ONE;
}
@e.e.b.a.c
public static int j(BigInteger bigInteger, RoundingMode roundingMode) {
int i2;
i.j("x", bigInteger);
if (e(bigInteger)) {
return h.o(bigInteger.longValue(), roundingMode);
}
int k = (int) ((k(bigInteger, RoundingMode.FLOOR) * f14159d) / c);
BigInteger pow = BigInteger.TEN.pow(k);
int compareTo = pow.compareTo(bigInteger);
if (compareTo > 0) {
do {
k--;
pow = pow.divide(BigInteger.TEN);
i2 = pow.compareTo(bigInteger);
} while (i2 > 0);
} else {
BigInteger multiply = BigInteger.TEN.multiply(pow);
int i3 = compareTo;
int compareTo2 = multiply.compareTo(bigInteger);
while (compareTo2 <= 0) {
k++;
BigInteger multiply2 = BigInteger.TEN.multiply(multiply);
int compareTo3 = multiply2.compareTo(bigInteger);
BigInteger bigInteger2 = multiply;
multiply = multiply2;
pow = bigInteger2;
i3 = compareTo2;
compareTo2 = compareTo3;
}
i2 = i3;
}
switch (a.a[roundingMode.ordinal()]) {
case 1:
i.k(i2 == 0);
break;
case 2:
case 3:
break;
case 4:
case 5:
return pow.equals(bigInteger) ? k : k + 1;
case 6:
case 7:
case 8:
return bigInteger.pow(2).compareTo(pow.pow(2).multiply(BigInteger.TEN)) <= 0 ? k : k + 1;
default:
throw new AssertionError();
}
return k;
}
public static int k(BigInteger bigInteger, RoundingMode roundingMode) {
i.j("x", (BigInteger) h0.E(bigInteger));
int bitLength = bigInteger.bitLength() - 1;
switch (a.a[roundingMode.ordinal()]) {
case 1:
i.k(g(bigInteger));
break;
case 2:
case 3:
break;
case 4:
case 5:
return g(bigInteger) ? bitLength : bitLength + 1;
case 6:
case 7:
case 8:
return bitLength < 256 ? bigInteger.compareTo(b.shiftRight(256 - bitLength)) <= 0 ? bitLength : bitLength + 1 : bigInteger.pow(2).bitLength() + (-1) < (bitLength * 2) + 1 ? bitLength : bitLength + 1;
default:
throw new AssertionError();
}
return bitLength;
}
@e.e.b.a.c
public static double l(BigInteger bigInteger, RoundingMode roundingMode) {
return C0876b.a.b(bigInteger, roundingMode);
}
@e.e.b.a.c
public static BigInteger m(BigInteger bigInteger, RoundingMode roundingMode) {
i.g("x", bigInteger);
if (e(bigInteger)) {
return BigInteger.valueOf(h.B(bigInteger.longValue(), roundingMode));
}
BigInteger o = o(bigInteger);
switch (a.a[roundingMode.ordinal()]) {
case 1:
i.k(o.pow(2).equals(bigInteger));
break;
case 2:
case 3:
break;
case 4:
case 5:
int intValue = o.intValue();
return intValue * intValue == bigInteger.intValue() && o.pow(2).equals(bigInteger) ? o : o.add(BigInteger.ONE);
case 6:
case 7:
case 8:
return o.pow(2).add(o).compareTo(bigInteger) >= 0 ? o : o.add(BigInteger.ONE);
default:
throw new AssertionError();
}
return o;
}
@e.e.b.a.c
private static BigInteger n(BigInteger bigInteger) {
return c.o(Math.sqrt(d.a(bigInteger)), RoundingMode.HALF_EVEN);
}
@e.e.b.a.c
private static BigInteger o(BigInteger bigInteger) {
BigInteger shiftLeft;
int k = k(bigInteger, RoundingMode.FLOOR);
if (k < 1023) {
shiftLeft = n(bigInteger);
} else {
int i2 = (k - 52) & (-2);
shiftLeft = n(bigInteger.shiftRight(i2)).shiftLeft(i2 >> 1);
}
BigInteger shiftRight = shiftLeft.add(bigInteger.divide(shiftLeft)).shiftRight(1);
if (shiftLeft.equals(shiftRight)) {
return shiftLeft;
}
while (true) {
BigInteger shiftRight2 = shiftRight.add(bigInteger.divide(shiftRight)).shiftRight(1);
if (shiftRight2.compareTo(shiftRight) >= 0) {
return shiftRight;
}
shiftRight = shiftRight2;
}
}
}