Class Scale

  • All Implemented Interfaces:
    Comparable<Scale>

    public class Scale
    extends Object
    implements Comparable<Scale>
    Immutable class for precision statements in after-floating point decimal digits.
    Author:
    Tilman Neumann
    • Method Detail

      • valueOf

        public static Scale valueOf​(int digits)
      • of

        public static Scale of​(float x)
      • of

        public static Scale of​(double x)
      • add

        public Scale add​(int n)
      • multiply

        public Scale multiply​(int multiplier)
      • getErrorBound

        public BigDecimal getErrorBound()
        The error a computation with this scale should not exceed. This is just half of an ulp for values with this scale, thus computation results should be correct to this scale after rounding.
        Returns:
        maximum allowed error
      • digits

        public int digits()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object