It is the year MDLXVII in a world in which the Roman Empire never fell, and the collapse into the dark ages never occurred. Due to the extended period of Pax Romana, the empire's economic stability enabled technology to progress at a rapid rate.
The Romans have begun to dabble with circuitry, and have invented an ingenious calculator that doesn't require the use of an "equals" button. They call it "Roman Polish Notation"
To make a calculation, they enter their operands first, then the operation.
For example, 100 + 11 * 20 would be
C XI XX * +.
The Romans have found that they often need to make multiple calculations at the same time, and would prefer for the method to return every value "on the stack" in some sort of array/list/tuple-like structure. (e.g.
X I + X I - CC II + would return [11, 9, 202])
The challenge is to develop a calculator program capable of making these computations.
Clarification: Subtractive Notation is required. I hadn't realized it wasn't recognized feature in the Ancient Roman empire. The task was therefore ambiguous, and I apologize.
- Your output will be in Arabic Numerals.
- You only need to convert from Roman Numerals up to 5000.
- You will need to support +, -, /, * operations (addition, subtraction, division, and multiplication).
- Whether division is floating point based or integer based is implementation specific. Either works for this challenge.
- Your output will need to support numbers up to 4 Billion.
- Shortest answer overall, AND in each language wins. This is a Code Golf Challenge but I love the variety.
In the event of a tie,
factors like support for roman numerals above 5000 or additional operations will be considered the earliest submission will win.