The goal of this project is to expand the functionality of the Python 3.x standard library Fraction class to accept anything that Fraction would and more: Mixed('3 4/5') == Mixed(3,4,5) == Mixed(Fraction(19,5)) etc (see examples section in the source for full list). This class is designed to behave exactly as a standard Fraction would except that 1) it supports string constructions of mixed number fractions, 2) it supports three argument construction in the form of whole_number,numerator, denominator, and 3) the string representation is formatted in mixed number form. All the methods and properties behave the same (except as noted above) with the addition of a fnumerator property which returns the numerator of the fractional portion of the number only and the addition of a whole property which behaves as a % 1 to return only the whole number portion of the number. Why? I wanted it. Python didn't have it. So I wrote it.

Project Activity

See All Activity >

Follow Python Mixed Fractions Class

Python Mixed Fractions Class Web Site

Other Useful Business Software
Build Securely on Azure with Proven Frameworks Icon
Build Securely on Azure with Proven Frameworks

Lay a foundation for success with Tested Reference Architectures developed by Fortinet’s experts. Learn more in this white paper.

Moving to the cloud brings new challenges. How can you manage a larger attack surface while ensuring great network performance? Turn to Fortinet’s Tested Reference Architectures, blueprints for designing and securing cloud environments built by cybersecurity experts. Learn more and explore use cases in this white paper.
Download Now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Python Mixed Fractions Class!

Additional Project Details

Registered

2013-11-16