Class BigIntegerExtensions


  • @GwtCompatible
    public class BigIntegerExtensions
    extends java.lang.Object
    This is an extension library for big integral numbers.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.math.BigInteger operator_divide​(java.math.BigInteger a, java.math.BigInteger b)
      The binary divide operator.
      static java.math.BigInteger operator_minus​(java.math.BigInteger a)
      The unary minus operator.
      static java.math.BigInteger operator_minus​(java.math.BigInteger a, java.math.BigInteger b)
      The binary minus operator.
      static java.math.BigInteger operator_modulo​(java.math.BigInteger a, java.math.BigInteger b)
      The binary modulo operator.
      static java.math.BigInteger operator_multiply​(java.math.BigInteger a, java.math.BigInteger b)
      The binary times operator.
      static java.math.BigInteger operator_plus​(java.math.BigInteger a, java.math.BigInteger b)
      The binary plus operator.
      static java.math.BigInteger operator_power​(java.math.BigInteger a, int exponent)
      The power operator.
      • Methods inherited from class java.lang.Object

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

      • BigIntegerExtensions

        public BigIntegerExtensions()
    • Method Detail

      • operator_minus

        @Pure
        public static java.math.BigInteger operator_minus​(java.math.BigInteger a)
        The unary minus operator.
        Parameters:
        a - a BigInteger. May not be null.
        Returns:
        -a
        Throws:
        java.lang.NullPointerException - if a is null.
      • operator_plus

        @Pure
        public static java.math.BigInteger operator_plus​(java.math.BigInteger a,
                                                         java.math.BigInteger b)
        The binary plus operator.
        Parameters:
        a - a BigInteger. May not be null.
        b - a BigInteger. May not be null.
        Returns:
        a.add(b)
        Throws:
        java.lang.NullPointerException - if a or b is null.
      • operator_minus

        @Pure
        public static java.math.BigInteger operator_minus​(java.math.BigInteger a,
                                                          java.math.BigInteger b)
        The binary minus operator.
        Parameters:
        a - a BigInteger. May not be null.
        b - a BigInteger. May not be null.
        Returns:
        a.subtract(b)
        Throws:
        java.lang.NullPointerException - if a or b is null.
      • operator_power

        @Pure
        public static java.math.BigInteger operator_power​(java.math.BigInteger a,
                                                          int exponent)
        The power operator.
        Parameters:
        a - a BigInteger. May not be null.
        exponent - the exponent.
        Returns:
        a.pow(b)
        Throws:
        java.lang.NullPointerException - if a null.
      • operator_multiply

        @Pure
        public static java.math.BigInteger operator_multiply​(java.math.BigInteger a,
                                                             java.math.BigInteger b)
        The binary times operator.
        Parameters:
        a - a BigInteger. May not be null.
        b - a BigInteger. May not be null.
        Returns:
        a.multiply(b)
        Throws:
        java.lang.NullPointerException - if a or b is null.
      • operator_divide

        @Pure
        public static java.math.BigInteger operator_divide​(java.math.BigInteger a,
                                                           java.math.BigInteger b)
        The binary divide operator.
        Parameters:
        a - a BigInteger. May not be null.
        b - a BigInteger. May not be null.
        Returns:
        a.divide(b)
        Throws:
        java.lang.NullPointerException - if a or b is null.
      • operator_modulo

        @Pure
        public static java.math.BigInteger operator_modulo​(java.math.BigInteger a,
                                                           java.math.BigInteger b)
        The binary modulo operator.
        Parameters:
        a - a BigInteger. May not be null.
        b - a BigInteger. May not be null.
        Returns:
        a.mod(b)
        Throws:
        java.lang.NullPointerException - if a or b is null.