Published November 15, 2026 | Version v1

Miryori - Roman Numerals Converter: Parsing Rules and Implementation Notes

Authors/Creators

Description

Roman numerals encode quantity as a subtractive positional system, and reading them backwards is a reliable way to generate invalid values. The seven standard symbols are I, V, X, L, C, D and M. Six pairs are subtractively legal: IV, IX, XL, XC, CD and CM. Any other smaller-before-larger pair, such as IL for 49 or IIX for 9, is not a valid Roman numeral even though naive parsers accept it.

Two parsing strategies disagree on malformed input. A greedy approach consumes the largest available symbol first and subtracts when a symbol is smaller than its successor; it silently normalises IL to 49. A strict left-to-right parse applies the subtraction rule only to the six legal pairs and rejects everything else, which is the behaviour a converter should have if the input is expected to be well formed.

Case is not significant: mmxxiv and MMXXIV denote the same number. The conventional notation has no symbol above M, so the classic range is 1 to 3,999, with MMXXIV equal to 2024. Extended forms using overlines for 5,000 and 10,000 are a separate convention and are not part of the standard set.

The https://www.miryori.org/tools/roman-numerals-converter implementation documents these rules and states its accepted range explicitly. Further material on the project is available at https://www.miryori.org/.

Files

zenodo-2026-11-15-roman-numerals-converter-notes.txt

Files (874 Bytes)

Name Size
md5:ffbbd75cca49cc05a1993ad6984f21ef
874 Bytes Preview Download