**Lee's Roman Numeral
Converter**

by Lee
K. Seitz

**Frequently Asked Questions**
What do the letters
stand for?

Why doesn't 1999 = MIM
(or 99 = IC or 999 = IM or ... )?

How do Roman numerals work?

Can you send me the source
code?

Why is there a limit of
3999?

**Q: What do
the letters stand for?**

A: I = 1, V = 5, X = 10, L
= 50, C = 100, D = 500, M = 1000.

**Q: Why doesn't
1999 = MIM (or 99 = IC or 999 = IM or ... )?**

A: The rules for Roman numerals
as I learned them include:

You can only subtract a power of ten from
any Roman numeral.

You can only subtract from the next two
higher "digits."

That is, you can only subtract I from V
and X. You can only subtract X from L and C. And you can only
subtract C from D and M. Or, in other words, subtraction is only
done for (4 x 10^{n}) and (9 x 10^{n}). (That
is, 4, 40, 400, 9, 90, and 900.)

Or, to put it a completely different way:
When converting to Roman numerals, convert each digit separately.
So for 999, convert 900, 90, and 9 to give CM, XC, and IX (CMXCIX).
Note that the Romans themselves didn't necessarily follow these
rules, but as with everything else in Western society, we created
more rules for it as time passed.

**Q: How do Roman
numerals work?**

A: That is a
section unto itself.

**Q: Can you
send me the source code?**

A: It seems writing an Arabic
to Roman numeral converter is a fairly common assignment in beginning
programming classes. I'm a firm believer in students doing their
own work, so I will not give the source to anyone. But I have
written a rather vague explanation
of how the code works.

**Q: Why is there
a limit of 3999?**

A: The highest "digit"
available is M. Writing 4000 in Roman numerals would require
subtracting 1000 (M) from 5000. There actually is a Roman numeral
for 5000; it's V with a bar over it. Unfortunately, doing this
notation in HTML is difficult at best, so I've simply limited
the converter to 3999.