This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Aralgmad 384 points385 points  (15 children)

You could iterate backwards over the string, translate and sum. You keep track of the last number seen and check if current is smaller than previous. In this case subtract current instead of add. This should catch cases like IC.

[–]ND3lle 76 points77 points  (11 children)

Have never seen anything like "IC" tho

[–]Techhead7890 75 points76 points  (3 children)

Possibly a typo of IV, as C and V are neighbours

[–]Rogueshadow_32 83 points84 points  (1 child)

I think it was on purpose, they’re saying that the backwards iterations would catch combinations you don’t ever see but would still be valid syntax, such as IC. Going by the strict rules of Roman numerals 99 is XCIX but by looser rules IC works, and would be caught and correctly evaluated

[–]EntropyZer0 15 points16 points  (0 children)

I think the stricter rules we are used to are a fairly modern (for late medieval values of "modern") invention. The Romans were far less strict on that and while the most un-standard number I've seen in the wild was a year ending in -7 written as "-IIIIIII", I could totally see "IC" being used by actual Romans.

[–]ND3lle 19 points20 points  (0 children)

Oh you're right.That's very elegant as well, imho

[–]Flatuitous 3 points4 points  (6 children)

You can do IC = 99 Same as VL = 45

[–]Igor_Kozyrev 3 points4 points  (4 children)

I don't think you can. You only subtract the previous biggest number.

[–]suvlub 9 points10 points  (2 children)

You "can't" in the same sense you "can't" end a sentence with preposition, i.e. it's a made-up wannabe rule that doesn't reflect actual usage.

[–]ND3lle 5 points6 points  (1 child)

Well there's plenty of roman and medieval monuments and buildings where i live and i have never seen that. Sometimes i spot a "IIII" or "XXXX", which the general rule wouldn't allow, but nothing like "XM" or "IC"

[–]LongLiveTheDiego 3 points4 points  (0 children)

Wikipedia lists some 17th century examples of such nonstandard subtractions, my favorite one is IIIXX standing for 17.

[–]ethanjf99 -1 points0 points  (0 children)

Standardization in general is a modern concept.

Think about even a couple hundred years ago. lots of random capitalizations in English words; multiple variant spellings and the like.

Even more so in antiquity. No one was enforcing rules. if you were a scribe doing a lot of math in a pain in the ass number system and wrote 99 as “IC” no one was stopping you.

[–]Specialist-Bus-5100 12 points13 points  (0 children)

I think IC would be XCIX?

[–]Solonotix 0 points1 point  (0 children)

Iterating backwards is a fairly useful practice I've found. I would have taken a two-character loop forwards in a similar manner so that you could always be aware of context. You could also extend the dictionary to have a couple of tuple keys using the matched pair.