mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-26 09:02:34 -06:00
47 lines
1.7 KiB
Java
47 lines
1.7 KiB
Java
package com.google.common.math;
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
|
|
@ElementTypesAreNonnullByDefault
|
|
/* loaded from: classes3.dex */
|
|
public class BigDecimalMath {
|
|
private BigDecimalMath() {
|
|
}
|
|
|
|
public static double roundToDouble(BigDecimal bigDecimal, RoundingMode roundingMode) {
|
|
return BigDecimalToDoubleRounder.INSTANCE.roundToDouble(bigDecimal, roundingMode);
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
private static class BigDecimalToDoubleRounder extends ToDoubleRounder<BigDecimal> {
|
|
static final BigDecimalToDoubleRounder INSTANCE = new BigDecimalToDoubleRounder();
|
|
|
|
private BigDecimalToDoubleRounder() {
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // com.google.common.math.ToDoubleRounder
|
|
public double roundToDoubleArbitrarily(BigDecimal bigDecimal) {
|
|
return bigDecimal.doubleValue();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // com.google.common.math.ToDoubleRounder
|
|
public int sign(BigDecimal bigDecimal) {
|
|
return bigDecimal.signum();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // com.google.common.math.ToDoubleRounder
|
|
public BigDecimal toX(double d, RoundingMode roundingMode) {
|
|
return new BigDecimal(d);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // com.google.common.math.ToDoubleRounder
|
|
public BigDecimal minus(BigDecimal bigDecimal, BigDecimal bigDecimal2) {
|
|
return bigDecimal.subtract(bigDecimal2);
|
|
}
|
|
}
|
|
}
|