AngouriMath
ModularInverse(AngouriMath.Entity.Number.Integer,AngouriMath.Entity.Number.Integer)
Method (no overloads)
Summary
The multiplicative inverse of a modulo n :
the one representative in[1, n - 1] of the class of x with
a x = 1 (mod n) , or null where there is none, which is
exactly whena and n share a factor. A class, never the number
1/a . https://github.com/asc-community/AngouriMath/issues/1409
the one representative in
exactly when
Example
Console.WriteLine(MathS.NumberTheory.ModularInverse(3, 10));
Console.WriteLine(MathS.NumberTheory.ModularInverse(6, 15) is null);Prints
7
TrueAngouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online