Roman Numeral Function
|
01-17-2016, 09:29 PM
(This post was last modified: 01-17-2016 10:51 PM by smp.)
Post: #1
|
|||
|
|||
Roman Numeral Function
Here's a simple function I created. Get a Roman Numeral as output for an integer input. Invoke by RN(integer).
Code:
This is pretty simple stuff, but I'm still learning PPL. UPDATE: I messed up and posted code that did not handle 40 properly. I've updated with the correct code. smp |
|||
01-19-2016, 09:46 PM
Post: #2
|
|||
|
|||
RE: Roman Numeral Function
Now all we need is the inverse function RN^(-1)(XLV) to convert from Roman numerals to integers. I think that would be more useful.
|
|||
01-19-2016, 10:12 PM
Post: #3
|
|||
|
|||
RE: Roman Numeral Function | |||
01-20-2016, 05:56 AM
Post: #4
|
|||
|
|||
RE: Roman Numeral Function
Here is an economical Roman to Arabic converter:
http://www.hpmuseum.org/forum/thread-164...ight=roman Perhaps someone could translate the programme into Prime? |
|||
01-20-2016, 01:08 PM
Post: #5
|
|||
|
|||
RE: Roman Numeral Function
(01-20-2016 05:56 AM)Gerald H Wrote: Here is an economical Roman to Arabic converter: With some checks on the input: Code: EXPORT R→A(r) |
|||
01-20-2016, 04:09 PM
Post: #6
|
|||
|
|||
RE: Roman Numeral Function
Bravo, Didier! All numbers tested so far correct.
I didn't really expect anyone to do this...at least not so quickly! |
|||
01-20-2016, 05:11 PM
Post: #7
|
|||
|
|||
RE: Roman Numeral Function
And here is a program to convert from Arabic to Roman representation:
Code: EXPORT A→R(N) |
|||
01-21-2016, 10:45 AM
Post: #8
|
|||
|
|||
RE: Roman Numeral Function
A very nice programme, Didier, which I have translated to the 49G here:
http://www.hpmuseum.org/forum/thread-5567.html Having again looked at the Prime I despair of using it - the pale blue & orange smudges on the keyboard are just too unclear. On the 50G, 49G, 48G & 42S using reading glasses I can manage, so until HP improve visibility I'll leave Prime programming to you & your ilk. |
|||
01-21-2016, 11:49 AM
Post: #9
|
|||
|
|||
RE: Roman Numeral Function
I agree, those two are very nice complement of utility programs, Didier. You seem especially well talented with the Prime, so thanks for those, and all the help you have provided along the way!
-Dale- |
|||
01-21-2016, 01:42 PM
Post: #10
|
|||
|
|||
RE: Roman Numeral Function
Hi!
Here there is a slightly modified version of Didiers's A→R, that also give good results for N between 1 and 3999 Code: EXPORT A→R(N) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)