Publisher review:Rational class provides an exact representation of rational numbers. This class provides an exact representation of rational numbers. All of the standard arithmetic operators are provided. In mixed-type expressions, an int or a long can be converted to a Rational without loss of precision, and will be done as such. Rationals can be implicity (using binary operators) or explicity (using float(x) or x.decimal()) converted to floats or Decimals; this may cause a loss of precision.
The reverse conversions can be done without loss of precision, and are performed with the from_exact static method. However, because of rounding error in the original values, this tends to produce "ugly" fractions. "Nicer" conversions to Rational can be made with approx_smallest_denominator or approx_smallest_error.
Rational 1.1 is a Python script for Mathematics scripts design by PyCode.
It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
Rational class provides an exact representation of rational numbers.
Operating system:Windows / Linux / Mac OS / BSD / Solaris