BigInteger.ModularInverse Method

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

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
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