$modinv » History » Version 1
Per Amundsen, 01/13/2023 07:12 AM
1 | 1 | Per Amundsen | _Added in 4.3_ |
---|---|---|---|
2 | |||
3 | *$modinv(base, modulus)* |
||
4 | |||
5 | Returns the "inverse modulus":https://en.wikipedia.org/wiki/Modular_multiplicative_inverse for the specified base and modulus. |
||
6 | |||
7 | *Parameters* |
||
8 | |||
9 | base - The base to calculate for. |
||
10 | modulus - The modulus to calculate for. |
||
11 | |||
12 | *Example* |
||
13 | |||
14 | <pre> |
||
15 | //echo -ag The inverse modulus for 2 and 1907 is $modinv(2, 1907) |
||
16 | </pre> |