Post Reply 
(EL-5030) Prime Factors
04-22-2022, 04:27 PM
Post: #4
RE: (EL-5030) Prime Factors
(04-22-2022 04:17 PM)Didier Lachieze Wrote:  Nice program! I've entered it on my EL-5030 but it returns 0 for any input.
I double checked the program in my EL-5030 vs. your listing and I don't see any difference.
However I'm wondering if the following sequence is correct:
Code:
            =N=>[
                C,
                X/C=>X
                <-\
            ]
What is the meaning of C, ?

I just double-checked the listing to make sure I didn't fat-finger anything when typing it in, and the listing looks okay.

The comma acts as "stop and display the result of the previous expression", so "C," is basically "PRINT C". In this program, C is the trial divisor, and if X<>INT (X/C)*C is false, that means C is a factor of X, so the program displays C, stores X/C into X, then repeats the trial division loop with the same value of C.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


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 - Dave Britten - 04-22-2022 04:27 PM
RE: (EL-5030) Prime Factors - C.Ret - 04-23-2022, 04:27 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: 2 Guest(s)