Package gnu.math

Class Numeric

    • Constructor Detail

      • Numeric

        public Numeric()
    • Method Detail

      • floatValue

        public float floatValue()
        Specified by:
        floatValue in class Number
      • intValue

        public int intValue()
        Specified by:
        intValue in class Number
      • longValue

        public long longValue()
        Specified by:
        longValue in class Number
      • add

        public abstract Numeric add​(Object obj,
                                    int k)
        Return this + k * obj.
      • abs

        public abstract Numeric abs()
      • neg

        public abstract Numeric neg()
      • toString

        public abstract String toString​(int radix)
      • asNumericOrNull

        public static Numeric asNumericOrNull​(Object value)
      • isExact

        public abstract boolean isExact()
      • toExact

        public Numeric toExact()
      • toInexact

        public Numeric toInexact()
      • isZero

        public abstract boolean isZero()
      • compare

        public int compare​(Object obj)
        Return an integer for which of this or obj is larger. Return 1 if this>obj; 0 if this==obj; -1 if this<obj; -2 if this!=obj otherwise (for example if either is NaN); -3 if not comparable (incompatible types).
      • compareReversed

        public int compareReversed​(Numeric x)
      • grt

        public boolean grt​(Object x)
      • geq

        public boolean geq​(Object x)
      • addReversed

        public Numeric addReversed​(Numeric x,
                                   int k)
        Calculate x+k&this.
      • div_inv

        public Numeric div_inv()
        Return the multiplicative inverse.
      • mul_ident

        public Numeric mul_ident()
        Return the multiplicative identity.
      • power

        public Numeric power​(IntNum y)
        Return this raised to an integer power. Implemented by repeated squaring and multiplication. If y < 0, returns div_inv of the result.