Popular recipes tagged "roman"http://code.activestate.com/recipes/tags/roman/2016-12-13T05:05:52-08:00ActiveState Code RecipesRoman Numeral Converter (Python)
2016-12-13T05:05:52-08:00Brandon Martinhttp://code.activestate.com/recipes/users/4194238/http://code.activestate.com/recipes/580731-roman-numeral-converter/
<p style="color: grey">
Python
recipe 580731
by <a href="/recipes/users/4194238/">Brandon Martin</a>
(<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/numbers/">numbers</a>, <a href="/recipes/tags/numerals/">numerals</a>, <a href="/recipes/tags/roman/">roman</a>).
</p>
<p>Provides two functions:
romanToNumber - Converts a string of Roman Numerals (I,V,X,L,C,D,M) into an integer. (ignores formatting, will return best guess if improperly formatted)
numberToRoman - Converts an integer into a string of Roman Numerals</p>
Roman numeral class with overloaded int methods (Python)
2011-04-06T14:52:06-07:00thom nealehttp://code.activestate.com/recipes/users/4176069/http://code.activestate.com/recipes/577640-roman-numeral-class-with-overloaded-int-methods/
<p style="color: grey">
Python
recipe 577640
by <a href="/recipes/users/4176069/">thom neale</a>
(<a href="/recipes/tags/homework/">homework</a>, <a href="/recipes/tags/int/">int</a>, <a href="/recipes/tags/overloading/">overloading</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/roman/">roman</a>).
</p>
<p>This Roman class is a subclass of int and supports the same methods int does, but any special methods that would normally return ints are return a new instance of Roman. You can use instances of this class in math expressions and a Roman instance will be returned, for example. </p>
<p>The class decorator used to achieve this was suggested by Alex Martelli '<a href="http://stackoverflow.com/questions/1242589/subclassing-int-to-attain-a-hex-representation/1243045#1243045">here</a> on stackoverlow.com.</p>
RomanNumeral to Integers (viceversa) (Java)
2010-07-18T11:20:19-07:00st0lehttp://code.activestate.com/recipes/users/4174421/http://code.activestate.com/recipes/577313-romannumeral-to-integers-viceversa/
<p style="color: grey">
Java
recipe 577313
by <a href="/recipes/users/4174421/">st0le</a>
(<a href="/recipes/tags/conversions/">conversions</a>, <a href="/recipes/tags/java/">java</a>, <a href="/recipes/tags/numbers/">numbers</a>, <a href="/recipes/tags/roman/">roman</a>).
</p>
<p>Converts Roman Symbols to Integers and back.</p>