Class Calculus


  • public final class Calculus
    extends java.lang.Object
    Mathematical helper class
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.math.MathContext DEFAULT_MATH_CONTEXT
      The default MathContext used for BigDecimal calculus.
      private static java.util.logging.Logger logger  
      static java.math.MathContext MATH_CONTEXT
      Exposes (non-final) the MathContext used for BigDecimal calculus.
      private static java.lang.String MSG_NUMBER_NON_NULL  
    • Constructor Summary

      Constructors 
      Constructor Description
      Calculus()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Number abs​(java.lang.Number number)
      Returns the absolute value of number
      static boolean isLessThanOne​(java.lang.Number number)  
      static java.lang.Number negate​(java.lang.Number number)
      Returns the negated value of number
      static java.math.BigDecimal toBigDecimal​(java.lang.Number number)
      Converts a number to BigDecimal
      static java.math.BigInteger toBigInteger​(java.lang.Number number)
      Converts a number to BigInteger
      • Methods inherited from class java.lang.Object

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

      • MSG_NUMBER_NON_NULL

        private static final java.lang.String MSG_NUMBER_NON_NULL
        See Also:
        Constant Field Values
      • logger

        private static final java.util.logging.Logger logger
      • DEFAULT_MATH_CONTEXT

        public static final java.math.MathContext DEFAULT_MATH_CONTEXT
        The default MathContext used for BigDecimal calculus.
      • MATH_CONTEXT

        public static java.math.MathContext MATH_CONTEXT
        Exposes (non-final) the MathContext used for BigDecimal calculus.
    • Constructor Detail

      • Calculus

        public Calculus()
    • Method Detail

      • toBigDecimal

        public static java.math.BigDecimal toBigDecimal​(java.lang.Number number)
        Converts a number to BigDecimal
        Parameters:
        number - the number to be converted
        Returns:
        the number converted
      • toBigInteger

        public static java.math.BigInteger toBigInteger​(java.lang.Number number)
        Converts a number to BigInteger
        Parameters:
        number - the number to be converted
        Returns:
        the number converted
      • abs

        public static java.lang.Number abs​(java.lang.Number number)
        Returns the absolute value of number
        Parameters:
        number -
        Returns:
      • negate

        public static java.lang.Number negate​(java.lang.Number number)
        Returns the negated value of number
        Parameters:
        number -
        Returns:
        -number
      • isLessThanOne

        public static boolean isLessThanOne​(java.lang.Number number)
        Parameters:
        number -
        Returns: