Class ModularPower


  • public class ModularPower
    extends Object
    Modular power.
    Author:
    Tilman Neumann
    • Constructor Detail

      • ModularPower

        public ModularPower()
    • Method Detail

      • modPow

        public int modPow​(BigInteger a,
                          int b,
                          int c)
        Computes a^b (mod c) for a BigInteger, b, c int. Very fast.
        Parameters:
        a -
        b -
        c -
        Returns:
        a^b (mod c)
      • modPow

        public int modPow​(int a,
                          int b,
                          int c)
        Computes a^b (mod c) for all-int arguments. Very fast.
        Parameters:
        a -
        b -
        c -
        Returns:
        a^b (mod c)