mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-26 17:12:31 -06:00
47 lines
2.5 KiB
Java
47 lines
2.5 KiB
Java
package kotlin.internal;
|
|
|
|
import androidx.media3.exoplayer.upstream.CmcdHeadersFactory;
|
|
import kotlin.Metadata;
|
|
|
|
/* compiled from: progressionUtil.kt */
|
|
@Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\t\n\u0002\b\u0006\u001a \u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u00012\u0006\u0010\u0004\u001a\u00020\u0001H\u0002\u001a \u0010\u0000\u001a\u00020\u00052\u0006\u0010\u0002\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0005H\u0002\u001a \u0010\u0006\u001a\u00020\u00012\u0006\u0010\u0007\u001a\u00020\u00012\u0006\u0010\b\u001a\u00020\u00012\u0006\u0010\t\u001a\u00020\u0001H\u0001\u001a \u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0007\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u00052\u0006\u0010\t\u001a\u00020\u0005H\u0001\u001a\u0018\u0010\n\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u0001H\u0002\u001a\u0018\u0010\n\u001a\u00020\u00052\u0006\u0010\u0002\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u0005H\u0002¨\u0006\u000b"}, d2 = {"differenceModulo", "", CmcdHeadersFactory.OBJECT_TYPE_AUDIO_ONLY, "b", "c", "", "getProgressionLastElement", "start", "end", "step", "mod", "kotlin-stdlib"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
|
/* loaded from: classes3.dex */
|
|
public final class ProgressionUtilKt {
|
|
private static final int mod(int i, int i2) {
|
|
int i3 = i % i2;
|
|
return i3 >= 0 ? i3 : i3 + i2;
|
|
}
|
|
|
|
private static final long mod(long j, long j2) {
|
|
long j3 = j % j2;
|
|
return j3 >= 0 ? j3 : j3 + j2;
|
|
}
|
|
|
|
private static final int differenceModulo(int i, int i2, int i3) {
|
|
return mod(mod(i, i3) - mod(i2, i3), i3);
|
|
}
|
|
|
|
private static final long differenceModulo(long j, long j2, long j3) {
|
|
return mod(mod(j, j3) - mod(j2, j3), j3);
|
|
}
|
|
|
|
public static final int getProgressionLastElement(int i, int i2, int i3) {
|
|
if (i3 > 0) {
|
|
return i >= i2 ? i2 : i2 - differenceModulo(i2, i, i3);
|
|
}
|
|
if (i3 < 0) {
|
|
return i <= i2 ? i2 : i2 + differenceModulo(i, i2, -i3);
|
|
}
|
|
throw new IllegalArgumentException("Step is zero.");
|
|
}
|
|
|
|
public static final long getProgressionLastElement(long j, long j2, long j3) {
|
|
if (j3 > 0) {
|
|
return j >= j2 ? j2 : j2 - differenceModulo(j2, j, j3);
|
|
}
|
|
if (j3 < 0) {
|
|
return j <= j2 ? j2 : j2 + differenceModulo(j, j2, -j3);
|
|
}
|
|
throw new IllegalArgumentException("Step is zero.");
|
|
}
|
|
}
|