Post Reply 
(50G) Digits sum (50g)
04-17-2020, 04:31 AM
Post: #7
RE: Digits sum (50g)
(04-15-2020 10:21 PM)John Keith Wrote:  ...For numbers larger than 100 digits, this strange program is actually faster:

Code:

\<<
  \->STR 0 SWAP 1. 9.
    FOR j j 48. + CHR "" SREPL j * ROT + SWAP
    NEXT DROP
\>>

SREPL is crazy fast, I have used it for lots of odd purposes like this.

This is a great example of the power of SREPL. I never would have thought of using it for that purpose, but it works quite well as you have indicated. The others are similarly well-suited for the tasks you identified.

SREPL is almost entirely written in Saturn code, and it makes repeated use of MOVE instructions which execute at native ARM speed. So it really is a speed demon.

Thanks to Juan, grsbanks, Nihotte(lma), and John Keith for all the thought-provoking concepts!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(50G) Digits sum (50g) - Juan14 - 04-12-2020, 08:05 PM
RE: Digits sum (50g) - grsbanks - 04-13-2020, 09:45 AM
RE: Digits sum (50g) - Nihotte(lma) - 04-13-2020, 08:38 PM
RE: Digits sum (50g) - Juan14 - 04-13-2020, 11:01 PM
RE: Digits sum (50g) - DavidM - 04-15-2020, 03:49 AM
RE: Digits sum (50g) - John Keith - 04-15-2020, 10:21 PM
RE: Digits sum (50g) - DavidM - 04-17-2020 04:31 AM
RE: Digits sum (50g) - Gerald H - 04-17-2020, 10:42 AM
RE: (50G) Digits sum (50g) - gor1060 - 12-11-2022, 11:15 AM



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