##### Why Doesn't XIV follow the Normal Rules?

Hi, I am trying to decode roman numerals with python, and it works for all other numbers such as "IV" or "MMVIII". But for "XIV", I am getting 16, while the answer should be 14. According to the rules, you should add if a small number comes after a big number. And if a big number comes after a small number you should subtract. So I am not sure why "XIV" doesn't follow that!

Can you please explain the process?

Thank you!

**Voters**

I thought that x = 10, i = 1, and v = 5. maybe that is why.

@idrgplayer That would be 16.

@SUHASTADIPARTH1 yeah so whats the problem? i dont understand

@idrgplayer, Yes x = 10, i = 1, and v = 5. So 10 + 1 + 5 = 16. But the answer is not 16, the actual answer is 14. That's what I don't understand. Why is it 14 instead of 16?

@SUHASTADIPARTH1 ohhh u wrote i am getting 16, while the answer should be 14 so i read it wrong.

@idrgplayer Yes! I was wondering why it is 14!

XIV would be 10 + ( 5 - 1 ) = 14. There is probably an error in whatever translator you are using. Why don't you try to code your own?

@LukeWright I tried, but it didn't work. And why did you subtract 5-1. I thought, when a small number comes after a big number, you should add.

yes that is correct, but in this case I = 1 and V = 5. The small number is coming before the bigger number so you subtract. Therefore IV = 4 and VI = 6 @SUHASTADIPARTH1

This would also hold true for other numerals. For example C = 100 and X = 10. XC would be 90 and CX would be 110 @SUHASTADIPARTH1

@LukeWright I see!, but i thought it goes from left to right. 10 => 1 => 5. 10 + 1 = 11 and 11 => 5!

@LukeWright So, do you have to simply the small numbers first before adding the big ones?

also, to answer your previous question, in plain english, XIV would be (10)(1)(5) where X = 10, I = 1, and V = 5

to create other numbers, different combinations of the different roman numberals are used. Here is 1-10 in Roman Numerals

I = 1

II = 2

III = 3

IV = 4

V = 5

VI = 6

VII = 7

VIII = 8

IX = 9

X = 10

@SUHASTADIPARTH1

@LukeWright Yup. I get it now! So, you to simply/combine/subtract the small numbers and move on to the big ones!

It does go from left to right, but any time you see a smaller number to the left of a bigger number, you subtract the smaller number from the bigger number. @SUHASTADIPARTH1

yes @SUHASTADIPARTH1

Although if you are trying to read ancient roman, don't forget that

A bar above a numeral means multiply it by 1,000

and that sometimes ancient romans use double subtractives

@LukeWright Ok, thank you! I will try out what you told in my code! I will let you know if it works!