I want to solve linear and quadratic modular equations in Haskell in one variable. The way I'm doing it right now is to put x = [1..] in the equation one by one and find the remainder ( expr `rem` p == 0 if the equation is modulo p (not necessarily simple), where expr has the variable x ). I think this is a very inefficient process. So is there a better way to do this?
haskell modular-arithmetic
Iguana
source share