Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 ( #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

  • Comment on Re: At the risk of saying something stupid-but-obvious about Roman Numerals
  • Download Code

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1085825]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2018-08-16 05:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (167 votes). Check out past polls.

    Notices?