### Roman Arithmetic

This is a demonstration of the methods that may have been used to perform calculations with numbers represented in Roman Numerals.

The JavaScript code used by this webpage can be viewed here.

Two versions in Python code can be viewed here and here.

### Convert Decimal Integer to Roman Integer

Enter a decimal integer between 1 and 3999 inclusive.

The Roman integer is MMXVI.

### Convert Roman Integer to Decimal Integer

Enter a Roman integer between 1 and 3999 inclusive.

The decimal integer is 2016.

Enter a Roman integer between 1 and 3999 inclusive.

Enter a second Roman integer between 1 and 3999 inclusive.

The Roman sum is (V)MMCMXCVIII.

The addition is performed by a method the Romans may have used.
The notation (V) is used to indicate 5000.

### Compare Two Roman Integers

Enter a Roman integer between 1 and 3999 inclusive.

Enter a second Roman integer between 1 and 3999 inclusive.

The Roman integers are equal.

The comparison is performed by a method the Romans may have used.

### Subtract one Roman Integer from another Roman Integer.

Enter a Roman integer between 1 and 3999 inclusive.

Enter a second Roman integer between 1 and 3999 inclusive.

The Roman difference is MMCCXXII.

The subtraction is performed by a method the Romans may have used.

### Multiply Two Roman Integers

Enter a Roman integer between 1 and 3999 inclusive.

Enter a second Roman integer between 1 and 3999 inclusive.

The Roman product is (V)MMDLII.

The multiplication is performed by a method the Romans may have used.

The notation (V) is used to indicate 5000, (L) to indicate 50000, etc.
In general, ( ) indicates one thousand times the basic numeral,
(( )) indicates one million times the basic numeral.

#### Roman Multiplication Table

```   |  I       V       X       L       C       D       M  |
___|_____________________________________________________|___
|                                                     |
I  |  I       V       X       L       C       D       M  |
|                                                     |
|                                                     |
V  |  V      XXV      L      CCL      D      MMD     (V) |
|                                                     |
|                                                     |
X  |  X       L       C       D       M      (V)     (X) |
|                                                     |
|                                                     |
L  |  L      CCL      D      MMD     (V)    (XXV)    (L) |
|                                                     |
|                                                     |
C  |  C       D       M      (V)     (X)     (L)     (C) |
|                                                     |
|                                                     |
D  |  D      MMD     (V)    (XXV)    (L)    (CCL)    (D) |
|                                                     |
|                                                     |
M  |  M      (V)     (X)     (L)     (C)     (D)     (M) |
___|_____________________________________________________|___
|                                                     |
```

### Divide one Roman Integer by another Roman Integer.

Enter a Roman integer between 1 and 3999 inclusive.

Enter a second Roman integer between 1 and 3999 inclusive.

The Roman quotient is CCLXIV and the remainder is VIII.

A zero quotient is indicated by the symbol N (nulla).

The divison is performed by a method the Romans may have used.