Popular recipes tagged "roman" but not "math"http://code.activestate.com/recipes/tags/roman-math/2011-04-06T14:52:06-07:00ActiveState Code RecipesRoman 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>