Solving a Single Congruence Equation
|
07-26-2015, 05:33 PM
(This post was last modified: 07-26-2015 05:40 PM by Thomas Klemm.)
Post: #10
|
|||
|
|||
RE: Solving a Single Congruence Equation
(07-25-2015 12:54 PM)Bunuel66 Wrote: I apologize for being too lazy for analyzing the algorithm given in the topic. No reason to apologize. I should have explained the algorithm or documented the program. But sometimes I'm too lazy. Quote:There is another approach using the extended Euclid Algorithm and the Bezout/Merignac theorem but it will be more complex to program. This alternate approach will be the faster at the price of an expense in memory and the use of a structure array like ;-( Guess what: the extended Euclid Algorithm is used in my program. (07-25-2015 09:04 PM)Bunuel66 Wrote: It is mainly a question of what you have in hand. If you are able to compute at least the square of your number without overflow then the modulo operation will limit the expansion at every step For this approach you may have a look at Gerald's post. However I tried to avoid splitting numbers: Code: 2. STO ST Y Instead I implemented the multiplication based on addition and made sure that an overflow can't happen: Code: 65>LBL 00 ; add ( y x -- y+x ) You might consider this approach a thought experiment. If overflow isn't an issue you can resort to the solution in this post. I assume it's faster than using Eddie's brute force approach but I haven't done any measurements. Kind regards Thomas |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Solving a Single Congruence Equation - Thomas Klemm - 04-18-2014, 05:24 PM
RE: Solving a Single Congruence Equation - Gerald H - 12-21-2014, 11:31 AM
RE: Solving a Single Congruence Equation - Ángel Martin - 07-24-2015, 12:23 PM
RE: Solving a Single Congruence Equation - Thomas Klemm - 07-24-2015, 08:00 PM
RE: Solving a Single Congruence Equation - Bunuel66 - 07-25-2015, 12:54 PM
RE: Solving a Single Congruence Equation - Thomas Klemm - 07-25-2015, 02:58 PM
RE: Solving a Single Congruence Equation - Bunuel66 - 07-25-2015, 09:04 PM
RE: Solving a Single Congruence Equation - Gerald H - 07-25-2015, 05:09 PM
RE: Solving a Single Congruence Equation - Thomas Klemm - 07-25-2015, 10:31 PM
RE: Solving a Single Congruence Equation - Thomas Klemm - 07-26-2015 05:33 PM
|
User(s) browsing this thread: 1 Guest(s)