Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,11 @@
// Calculate the inverse of a (mod m)
// See here for eea specs:
// https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm
let modInv m a =
let rec eea t t' r r' =
match r' with
| 0 -> t
| _ ->
let div = r/r'
eea t' (t - div * t') r' (r - div * r')
(m + eea 0 1 m a) % m