- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
43 lines
1.6 KiB
Java
43 lines
1.6 KiB
Java
package kotlin.random;
|
|
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.ranges.IntRange;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public abstract class RandomKt {
|
|
public static final int takeUpperBits(int i, int i2) {
|
|
return (i >>> (32 - i2)) & ((-i2) >> 31);
|
|
}
|
|
|
|
public static final int nextInt(Random random, IntRange range) {
|
|
Intrinsics.checkNotNullParameter(random, "<this>");
|
|
Intrinsics.checkNotNullParameter(range, "range");
|
|
if (!range.isEmpty()) {
|
|
return range.getLast() < Integer.MAX_VALUE ? random.nextInt(range.getFirst(), range.getLast() + 1) : range.getFirst() > Integer.MIN_VALUE ? random.nextInt(range.getFirst() - 1, range.getLast()) + 1 : random.nextInt();
|
|
}
|
|
throw new IllegalArgumentException("Cannot get random in empty range: " + range);
|
|
}
|
|
|
|
public static final int fastLog2(int i) {
|
|
return 31 - Integer.numberOfLeadingZeros(i);
|
|
}
|
|
|
|
public static final void checkRangeBounds(int i, int i2) {
|
|
if (i2 <= i) {
|
|
throw new IllegalArgumentException(boundsErrorMessage(Integer.valueOf(i), Integer.valueOf(i2)).toString());
|
|
}
|
|
}
|
|
|
|
public static final void checkRangeBounds(long j, long j2) {
|
|
if (j2 <= j) {
|
|
throw new IllegalArgumentException(boundsErrorMessage(Long.valueOf(j), Long.valueOf(j2)).toString());
|
|
}
|
|
}
|
|
|
|
public static final String boundsErrorMessage(Object from, Object until) {
|
|
Intrinsics.checkNotNullParameter(from, "from");
|
|
Intrinsics.checkNotNullParameter(until, "until");
|
|
return "Random range is empty: [" + from + ", " + until + ").";
|
|
}
|
|
}
|