Common
crt :: Integral a => (a, a) -> (a, a) -> (a, a) Source #
Chinese remainder theorem.
crt (r1, q1) (r2, q2) == (r3, q3) ==>
r3 mod q1 == r1 && q3 mod q1 == 0 && r3 mod q2 == r2 && q3 mod q2 == 0
mod
egcd :: Integral a => a -> a -> (a, a, a) Source #
Extended GCD.
gcd a b == (s, t, g) ==> a * s + b * t == g
readEntire :: Reader a -> Text -> Either String a Source #