dkh.numeric.primitive

Members

Functions

extGcd
T[3] extGcd(in T a, in T b)

a*T[0]+b*T[1]=T[2], T[2]=gcd

invMod
T invMod(T x, T md)

calc inverse, (x * invMod(x)) % md == 1

lcm
T lcm(in T a, in T b)

lcm

pow
Unqual!T pow(T x, U n)
Unqual!T pow(T x, U n, V e)

高速累乗

powMod
T powMod(T x, U n, V md)

Meta