Package com.google.common.math
Class BigDecimalMath.BigDecimalToDoubleRounder
- java.lang.Object
-
- com.google.common.math.ToDoubleRounder<java.math.BigDecimal>
-
- com.google.common.math.BigDecimalMath.BigDecimalToDoubleRounder
-
- Enclosing class:
- BigDecimalMath
private static class BigDecimalMath.BigDecimalToDoubleRounder extends ToDoubleRounder<java.math.BigDecimal>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static BigDecimalMath.BigDecimalToDoubleRounderINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privateBigDecimalToDoubleRounder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.math.BigDecimalminus(java.math.BigDecimal a, java.math.BigDecimal b)Returns a - b, guaranteed that both arguments are nonnegative.(package private) doubleroundToDoubleArbitrarily(java.math.BigDecimal bigDecimal)Returns x rounded to either the greatest double less than or equal to the precise value of x, or the least double greater than or equal to the precise value of x.(package private) intsign(java.math.BigDecimal bigDecimal)Returns the sign of x: either -1, 0, or 1.(package private) java.math.BigDecimaltoX(double d, java.math.RoundingMode mode)Returns d's value as an X, rounded with the specified mode.-
Methods inherited from class com.google.common.math.ToDoubleRounder
roundToDouble
-
-
-
-
Field Detail
-
INSTANCE
static final BigDecimalMath.BigDecimalToDoubleRounder INSTANCE
-
-
Method Detail
-
roundToDoubleArbitrarily
double roundToDoubleArbitrarily(java.math.BigDecimal bigDecimal)
Description copied from class:ToDoubleRounderReturns x rounded to either the greatest double less than or equal to the precise value of x, or the least double greater than or equal to the precise value of x.- Specified by:
roundToDoubleArbitrarilyin classToDoubleRounder<java.math.BigDecimal>
-
sign
int sign(java.math.BigDecimal bigDecimal)
Description copied from class:ToDoubleRounderReturns the sign of x: either -1, 0, or 1.- Specified by:
signin classToDoubleRounder<java.math.BigDecimal>
-
toX
java.math.BigDecimal toX(double d, java.math.RoundingMode mode)Description copied from class:ToDoubleRounderReturns d's value as an X, rounded with the specified mode.- Specified by:
toXin classToDoubleRounder<java.math.BigDecimal>
-
minus
java.math.BigDecimal minus(java.math.BigDecimal a, java.math.BigDecimal b)Description copied from class:ToDoubleRounderReturns a - b, guaranteed that both arguments are nonnegative.- Specified by:
minusin classToDoubleRounder<java.math.BigDecimal>
-
-