abstract class ToDoubleRounder<X extends java.lang.Number & java.lang.Comparable<X>>
extends java.lang.Object
X
to a representable double
value according to
a RoundingMode
.Constructor and Description |
---|
ToDoubleRounder() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract X |
minus(X a,
X b)
Returns a - b, guaranteed that both arguments are nonnegative.
|
(package private) double |
roundToDouble(X x,
java.math.RoundingMode mode)
Rounds
x to a double . |
(package private) abstract double |
roundToDoubleArbitrarily(X x)
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) abstract int |
sign(X x)
Returns the sign of x: either -1, 0, or 1.
|
(package private) abstract X |
toX(double d,
java.math.RoundingMode mode)
Returns d's value as an X, rounded with the specified mode.
|
abstract double roundToDoubleArbitrarily(X x)
abstract int sign(X x)
abstract X toX(double d, java.math.RoundingMode mode)
final double roundToDouble(X x, java.math.RoundingMode mode)
x
to a double
.