Class ToDoubleRounder<X extends java.lang.Number & java.lang.Comparable<X>>

    • Constructor Summary

      Constructors 
      Constructor Description
      ToDoubleRounder()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ToDoubleRounder

        ToDoubleRounder()
    • Method Detail

      • roundToDoubleArbitrarily

        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.
      • sign

        abstract int sign​(X x)
        Returns the sign of x: either -1, 0, or 1.
      • toX

        abstract X toX​(double d,
                       java.math.RoundingMode mode)
        Returns d's value as an X, rounded with the specified mode.
      • minus

        abstract X minus​(X a,
                         X b)
        Returns a - b, guaranteed that both arguments are nonnegative.
      • roundToDouble

        final double roundToDouble​(X x,
                                   java.math.RoundingMode mode)
        Rounds x to a double.