Post Reply 
Faster factor finder method for 42S
12-02-2019, 12:19 PM
Post: #13
RE: Faster factor finder method for 42S
(12-02-2019 07:17 AM)Werner Wrote:  Great idea, Dave!
Can't wait to rewrite my own routine using this idea! (using only the stack, and without flags ;-)
There's a simpler way of finding out whether there's a zero in your remainders: (and no need for the matrix R)

Code:
 SF 25
 1/X
 FC?C 25
 GTO 02

Very clever! That won't tell you where in the matrix there was a zero, so you'll have to take additional steps to find it, but optimizing for the common case (i.e. no factors found) makes sense.

It's a shame that MOD won't work with matrices the same way division and 1/X will. In its current state, the matrix approach won't work with 12-digit numbers, since the fractional part will be lost with small divisors (any result where the fractional part rounds down to .0 will have the same issue).
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Faster factor finder method for 42S - Dave Britten - 12-02-2019 12:19 PM



User(s) browsing this thread: 2 Guest(s)