Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: At the risk of saying something stupid-but-obvious about Roman Numerals

by Limbic~Region (Chancellor)
on May 12, 2014 at 19:49 UTC ( [id://1085825] : note . print w/replies, xml ) Need Help??


in reply to At the risk of saying something stupid-but-obvious about Roman Numerals

sundialsvc4,
Something seems fishy with your code.
my $roman = "MCCMLXXIV"; #1874
Shouldn't that be MDCCCLXXIV? I am pretty sure what you have isn't valid.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: At the risk of saying something stupid-but-obvious about Roman Numerals
by Anonymous Monk on May 12, 2014 at 23:28 UTC

    Or even, MDCCCLXXIIII. Romans probably treated the numbers like a bag of coins. To add two numbers, just lump them together. Substractive forms (IV, IX, XL, XC, CD, CM), and even double substractives (such as CCM) would also occur, according to wikipedia.