introducing 'mixed', a module providing a class for handling mixed numbers and fractions. Parses string and float inputs and handles arithmetic correctly.<br><br>easy_install mixed<br>development version: hg clone <a href="http://hg.assembla.com/mixed_python">http://hg.assembla.com/mixed_python</a> mixed_python<br>
Homepage and trac: <a href="http://trac-hg.assembla.com/mixed_python/">http://trac-hg.assembla.com/mixed_python/</a><br clear="all"><br><pre class="wiki">>>> from mixed import Mixed<br>>>> m1 = Mixed('4 2/3')<br>
>>> m2 = Mixed('4/10')<br>>>> m2.reduced()<br>Mixed('2/5')<br>>>> m1 + m2<br>Mixed('5 1/15')<br>>>> print m1 / m2<br>11 2/3<br>>>> Mixed(-1.5)<br>Mixed('-1 1/2')<br>
>>> Mixed(2./3.)<br>Mixed('2/3')<br><br></pre>-- <br>- Catherine<br><a href="http://catherinedevlin.blogspot.com/">http://catherinedevlin.blogspot.com/</a><br>*** PyCon 2008 * Chicago * March 13-20 * <a href="http://us.pycon.org">us.pycon.org</a> ***