romanclass
Roman class for python
Roman class for python
This is a demonstration of creating a class which is a subset of integers. This python module defines numbers which are read and written using Roman notation, so that II + II = IV. It may be useful for such applications as numbering American football superbowls and page numbers before page 1. It is a fairly complete implementation including mathematical operations, and can be used somewhat like the Decimal module. It makes full use of Roman numeral unicode code points to handle numbers in the range zero to 599,999, and it has an optional method to produce pure unicode Roman characters, such as \u216b for the number twelve (rather than the ASCII 'XII') in case you are making clock faces. This module was inspired by PEP 313.
2009-12-18 07:37:16 UTC
Python
Active