122 lines
2.9 KiB
Java
122 lines
2.9 KiB
Java
package o;
|
|
|
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
import java.io.Serializable;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class Axo extends Number implements Comparable<Axo>, Serializable {
|
|
public final long b;
|
|
public final long c;
|
|
|
|
@Override // java.lang.Comparable
|
|
public final /* synthetic */ int compareTo(Axo axo) {
|
|
return Double.compare(doubleValue(), axo.doubleValue());
|
|
}
|
|
|
|
public Axo(long j, long j2) {
|
|
this.b = j;
|
|
this.c = j2;
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public final byte byteValue() {
|
|
return (byte) doubleValue();
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public final int intValue() {
|
|
return (int) doubleValue();
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public final long longValue() {
|
|
return (long) doubleValue();
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public final short shortValue() {
|
|
return (short) doubleValue();
|
|
}
|
|
|
|
public final boolean b() {
|
|
long j = this.c;
|
|
return j == 1 || (j != 0 && this.b % j == 0) || (j == 0 && this.b == 0);
|
|
}
|
|
|
|
public final String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(this.b);
|
|
sb.append("/");
|
|
sb.append(this.c);
|
|
return sb.toString();
|
|
}
|
|
|
|
public final String d(boolean z) {
|
|
if (this.c == 0 && this.b != 0) {
|
|
return toString();
|
|
}
|
|
if (b()) {
|
|
return Integer.toString(intValue());
|
|
}
|
|
long j = this.b;
|
|
long j2 = this.c;
|
|
if (j2 < 0) {
|
|
j = -j;
|
|
j2 = -j2;
|
|
}
|
|
long j3 = j < 0 ? -j : j;
|
|
long j4 = j2 < 0 ? -j2 : j2;
|
|
while (j3 != 0 && j4 != 0) {
|
|
if (j3 > j4) {
|
|
j3 %= j4;
|
|
} else {
|
|
j4 %= j3;
|
|
}
|
|
}
|
|
if (j3 == 0) {
|
|
j3 = j4;
|
|
}
|
|
Axo axo = new Axo(j / j3, j2 / j3);
|
|
if (z) {
|
|
String d = Double.toString(axo.doubleValue());
|
|
if (d.length() < 5) {
|
|
return d;
|
|
}
|
|
}
|
|
return axo.toString();
|
|
}
|
|
|
|
public final boolean equals(Object obj) {
|
|
return (obj instanceof Axo) && doubleValue() == ((Axo) obj).doubleValue();
|
|
}
|
|
|
|
public final boolean d() {
|
|
long j = this.b;
|
|
if (!(j == 0 || this.c == 0)) {
|
|
if ((j > 0) == (this.c > 0)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return (((int) this.c) * 23) + ((int) this.b);
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public final float floatValue() {
|
|
long j = this.b;
|
|
return j == 0 ? BitmapDescriptorFactory.HUE_RED : ((float) j) / ((float) this.c);
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public final double doubleValue() {
|
|
long j = this.b;
|
|
if (j == 0) {
|
|
return 0.0d;
|
|
}
|
|
return j / this.c;
|
|
}
|
|
}
|