(EL-5030) Prime Factors
|
04-23-2022, 04:27 AM
(This post was last modified: 04-23-2022 09:45 AM by C.Ret.)
Post: #9
|
|||
|
|||
RE: (EL-5030) Prime Factors
(04-22-2022 09:37 PM)Didier Lachieze Wrote: This one works also with a few changes: Thanks for pointing out all those silly mistakes! As I don't have an AER device, I try my code on BASIC SHARP and I accidentally mixed up codes in the notepad before copying and pasting. Much better AER code here: Code: M:f(X)= #1 └►F+10*FRAC (A[I])=>F˽INT (A[I])=>I└►X/F=>Q˽F>Q =Y=>[DIM A[1]˽-X■]Q≠INT (Q)=N=>[F,Q=>X◄┐]◄┐ This code is longer than it appears on the voluntarily reduced form! I'm not sure it's shorter or faster anymore since the F>Q 'end-test' is done at each iteration; in the initial code the test X>C*C only takes place once after the 8th iteration. How much time does it save or lose? I imagine the speed improvements will greatly depend on specific values for X. Can the sequence INT (A[I])=>I be replaced by a simpler A[I]=>I ? Did the EL-5030 accept the reduced syntax INT A[I] or FRAC A[I] instead of INT (A[I]) or FRAC (A[I]) like the PC-1211 does? |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(EL-5030) Prime Factors - Dave Britten - 04-21-2022, 03:01 PM
RE: (EL-5030) Prime Factors - Jlouis - 04-22-2022, 02:02 AM
RE: (EL-5030) Prime Factors - Didier Lachieze - 04-22-2022, 04:17 PM
RE: (EL-5030) Prime Factors - Dave Britten - 04-22-2022, 04:27 PM
RE: (EL-5030) Prime Factors - Didier Lachieze - 04-22-2022, 09:37 PM
RE: (EL-5030) Prime Factors - C.Ret - 04-23-2022 04:27 AM
RE: (EL-5030) Prime Factors - Didier Lachieze - 04-23-2022, 08:31 AM
RE: (EL-5030) Prime Factors - C.Ret - 04-22-2022, 06:48 PM
RE: (EL-5030) Prime Factors - Dave Britten - 04-22-2022, 07:02 PM
RE: (EL-5030) Prime Factors - C.Ret - 04-22-2022, 08:07 PM
RE: (EL-5030) Prime Factors - C.Ret - 04-23-2022, 05:07 PM
|
User(s) browsing this thread: 1 Guest(s)