Post Reply 
[VA] SRC #012c - Then and Now: Sum
11-29-2022, 01:41 AM (This post was last modified: 11-29-2022 08:16 PM by FLISZT.)
Post: #4
RE: [VA] SRC #012c - Then and Now: Sum
Hi Valentin !

Thank you for welcoming me.

Yes I'm ready.

With the 9th Symphony of Bruckner broadcasted at the radio / Eugen Jochum / Bavarian Radio Orchestra (1954) and now the Concerto for Piano & Orch #3 / Robert Casadesus, New York Philh, Dimitri Mitropoulos (live, 1957)… how could it not be the case?! Wink

Here is my attempt:

@ duplication of the value n; m is initialized at 1 (the neutral element of the multiplication…)
<<
DUP 1 -> b m

@ flag 1 is set; BIN mode selected
<<
1 SF
BIN

@ as long as flag 1 is set
WHILE 1 FS?
REPEAT
b 2 > IF
THEN

@ start counting the number of binary digits:
@ conversion of b into a binary object
b R->B
@ conversion of this object into a string (10 ⇒ "# 1010b")
->STR
SIZE

@ size of the string minus 3 characters
@ 2 of them are the "prefix" of the binary object / 1 is the suffix: "b"
3 -
@ n * f(d(n))
DUP
'b' STO
m *
'm' STO
ELSE

@ flag 1 is cleared (signal of ending the "WHILE" loop)
1 CF
END
END

@ The last calculated value of m (or 1… ) is multiplied
@ by the value of n put in the stack at the very beginning
m *
>>
>>



Edit: typo
Edit2 : no code panel!

Bruno
Sanyo CZ-0124 ⋅ TI-57 ⋅ HP-15C ⋅ Canon X-07 + XP-140 Monitor Card ⋅ HP-41CX ⋅ HP-28S ⋅ HP-50G ⋅ HP-50G
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #012c - Then and Now: Sum - FLISZT - 11-29-2022 01:41 AM



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