HP 42S: Programming Complexity Question
|
01-25-2016, 05:26 PM
Post: #1
|
|||
|
|||
HP 42S: Programming Complexity Question
Is it really more difficult to convert Arabic numbers to Roman than Roman to Arabic?
Here a 42S programme for A2R http://www.hpmuseum.org/forum/thread-5583.html size is 162 Bytes & here for R2A http://www.hpmuseum.org/forum/thread-164...ight=roman size 78 Bytes. Is it my poor programming or is the inverse problem really so much more difficult? |
|||
01-25-2016, 11:03 PM
Post: #2
|
|||
|
|||
RE: HP 42S: Programming Complexity Question
"Back in the day" it was noted the longer calendar printing programs (HP41 series) tended to print calendars faster then the shorter programs.
I've tried to not let anything about programming amaze me since. 2speed HP41CX,int2XMEM+ZEN, HPIL+DEVEL, HPIL+X/IO, I/R, 82143, 82163, 82162 -25,35,45,55,65,67,70,80 |
|||
01-26-2016, 07:25 AM
Post: #3
|
|||
|
|||
RE: HP 42S: Programming Complexity Question | |||
01-26-2016, 07:37 AM
Post: #4
|
|||
|
|||
RE: HP 42S: Programming Complexity Question | |||
01-26-2016, 12:15 PM
(This post was last modified: 09-29-2016 08:57 AM by renif.)
Post: #5
|
|||
|
|||
RE: HP 42S: Programming Complexity Question
"Is it really more difficult to convert Arabic numbers to Roman than Roman to Arabic?"
Well, that definitely is a question relating to the mathematical structure of the problem. IMHO the size comparison between the two codes for the HP-42s at least gives a hint. It seems to be similar on other machines and in other languages, but this difference becomes especially apparent with implementations in an environment with very restricted memory, where the conversion Roman to Arabic can be realized, but not the opposite. In my old collection of programs, e.g. I found one for the TI-57 (max. 50 program steps) converting from Roman to Arabic (or better: Hindu numeral system). Never saw a program for the TI-57 converting from Hindu to Roman numerals. But that's only another hint, not a real proof, that the one algorithm is more difficult than the other. |
|||
01-26-2016, 01:42 PM
Post: #6
|
|||
|
|||
RE: HP 42S: Programming Complexity Question
Here a smaller A2R programme which produces valid Roman numerals BUT only produces forms such as MIIII for 1004 & not MIV:
Code:
|
|||
01-26-2016, 04:28 PM
Post: #7
|
|||
|
|||
RE: HP 42S: Programming Complexity Question | |||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)