Copyright | (c) 2018 Andrew Lelechenko |
---|---|
License | MIT |
Maintainer | Andrew Lelechenko <andrew.lelechenko@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Math.NumberTheory.Moduli.Equations
Description
Polynomial modular equations.
Documentation
Find all solutions of ax + b ≡ 0 (mod m).
>>>
:set -XDataKinds
>>>
solveLinear (6 :: Mod 10) 4 -- solving 6x + 4 ≡ 0 (mod 10)
[(1 `modulo` 10),(6 `modulo` 10)]
Find all solutions of ax² + bx + c ≡ 0 (mod m).
>>>
:set -XDataKinds
>>>
solveQuadratic (1 :: Mod 32) 0 (-17) -- solving x² - 17 ≡ 0 (mod 32)
[(9 `modulo` 32),(25 `modulo` 32),(7 `modulo` 32),(23 `modulo` 32)]