Package com.google.common.math
Class BigIntegerMath.BigIntegerToDoubleRounder
- java.lang.Object
-
- com.google.common.math.ToDoubleRounder<java.math.BigInteger>
-
- com.google.common.math.BigIntegerMath.BigIntegerToDoubleRounder
-
- Enclosing class:
- BigIntegerMath
private static class BigIntegerMath.BigIntegerToDoubleRounder extends ToDoubleRounder<java.math.BigInteger>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static BigIntegerMath.BigIntegerToDoubleRounder
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
BigIntegerToDoubleRounder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.math.BigInteger
minus(java.math.BigInteger a, java.math.BigInteger b)
Returns a - b, guaranteed that both arguments are nonnegative.(package private) double
roundToDoubleArbitrarily(java.math.BigInteger bigInteger)
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.BigInteger bigInteger)
Returns the sign of x: either -1, 0, or 1.(package private) java.math.BigInteger
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 BigIntegerMath.BigIntegerToDoubleRounder INSTANCE
-
-
Method Detail
-
roundToDoubleArbitrarily
double roundToDoubleArbitrarily(java.math.BigInteger bigInteger)
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.BigInteger>
-
sign
int sign(java.math.BigInteger bigInteger)
Description copied from class:ToDoubleRounder
Returns the sign of x: either -1, 0, or 1.- Specified by:
sign
in classToDoubleRounder<java.math.BigInteger>
-
toX
java.math.BigInteger 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.BigInteger>
-
minus
java.math.BigInteger minus(java.math.BigInteger a, java.math.BigInteger b)
Description copied from class:ToDoubleRounder
Returns a - b, guaranteed that both arguments are nonnegative.- Specified by:
minus
in classToDoubleRounder<java.math.BigInteger>
-
-