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.BigDecimalToDoubleRounder
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
BigDecimalToDoubleRounder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.math.BigDecimal
minus(java.math.BigDecimal a, java.math.BigDecimal b)
Returns a - b, guaranteed that both arguments are nonnegative.(package private) double
roundToDoubleArbitrarily(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) int
sign(java.math.BigDecimal bigDecimal)
Returns the sign of x: either -1, 0, or 1.(package private) java.math.BigDecimal
toX(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:ToDoubleRounder
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.- Specified by:
roundToDoubleArbitrarily
in classToDoubleRounder<java.math.BigDecimal>
-
sign
int sign(java.math.BigDecimal bigDecimal)
Description copied from class:ToDoubleRounder
Returns the sign of x: either -1, 0, or 1.- Specified by:
sign
in classToDoubleRounder<java.math.BigDecimal>
-
toX
java.math.BigDecimal toX(double d, java.math.RoundingMode mode)
Description copied from class:ToDoubleRounder
Returns d's value as an X, rounded with the specified mode.- Specified by:
toX
in classToDoubleRounder<java.math.BigDecimal>
-
minus
java.math.BigDecimal minus(java.math.BigDecimal a, java.math.BigDecimal b)
Description copied from class:ToDoubleRounder
Returns a - b, guaranteed that both arguments are nonnegative.- Specified by:
minus
in classToDoubleRounder<java.math.BigDecimal>
-
-