BigInteger.ModularInverse Method

Computes the modular inverse of an integer with respect to the specified modulus.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static BigInteger ModularInverse(
	BigInteger value,
	BigInteger modulus
)

Parameters

value  BigInteger
modulus  BigInteger
The modulus

Return Value

BigInteger
The modular inverse of value with respect to modulus.

Remarks

The modular inverse exists only if value and modulus are mutually prime.

Exceptions

ArithmeticException The modular inverse does not exist.
ArgumentOutOfRangeExceptionmodulus is equal to zero.
ArithmeticException The modular inverse does not exist.

See Also