Solving a Single Congruence Equation
|
04-15-2014, 11:31 PM
(This post was last modified: 04-15-2014 11:31 PM by Han.)
Post: #5
|
|||
|
|||
RE: Solving a Single Congruence Equation
In keeping the algorithm fairly simple, I was thinking of the following adjustment. If \(A > B\) then compute \( (q,r) \in \mathbb{Z}^2 \) such that \( A = qB + r\). Then
\[ Ai - B \equiv (qB+r)i - B \equiv B (qi -1) + ri \] and let \( i \) run from \( -N/2 \) to \( N/2 \) (adjusting for even/odd \( N \) of course). Similarly, if \( B = qA + r \) then \[ Ai - B \equiv Ai - (qA+r) \equiv A (i-q) -r \] We still run into overflow issues, but I think this approach might handle a few more cases than the original approach. Also, I wonder if the MOD command would work better than division inside FP(). Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)