Package de.tilman_neumann.jml.modular
Class ModularPower
- java.lang.Object
-
- de.tilman_neumann.jml.modular.ModularPower
-
public class ModularPower extends Object
Modular power.- Author:
- Tilman Neumann
-
-
Constructor Summary
Constructors Constructor Description ModularPower()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
modPow(int a, int b, int c)
Computes a^b (mod c) for all-int arguments.int
modPow(BigInteger a, int b, int c)
Computes a^b (mod c) fora
BigInteger,b, c
int.
-
-
-
Method Detail
-
modPow
public int modPow(BigInteger a, int b, int c)
Computes a^b (mod c) fora
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)
-
-