NZMATH
1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
![]() ![]() |
Classes | |
class | Integer |
class | IntegerRing |
class | Rational |
class | RationalField |
Functions | |
def | isIntegerObject (anObject) |
def | IntegerIfIntOrLong (anObject) |
def | continued_fraction_expansion (target, terms) |
Variables | |
theIntegerRing = IntegerRing() | |
theRationalField = RationalField() | |
rational module provides Rational, Integer, RationalField, and IntegerRing.
def nzmath.rational.continued_fraction_expansion | ( | target, | |
terms | |||
) |
Return continued fraction expansion of a real number. >>> continued_fraction_expansion(1.4142, 2) [1, 2, 2] The first component is the integer part, and rest is fractional part, whose number of terms is specified by the second argument.
Definition at line 951 of file rational.py.
References nzmath.bigrange.range().
Referenced by nzmath.rational.Rational.__init__().
def nzmath.rational.IntegerIfIntOrLong | ( | anObject | ) |
Cast int or long objects to Integer. The objects in list or tuple can be casted also.
Definition at line 938 of file rational.py.
def nzmath.rational.isIntegerObject | ( | anObject | ) |
True if the given object is instance of int or long, False otherwise.
Definition at line 931 of file rational.py.
Referenced by nzmath.rational.Rational.__add__(), nzmath.rational.Integer.__add__(), nzmath.rational.RationalField.__contains__(), nzmath.rational.IntegerRing.__contains__(), nzmath.rational.Rational.__eq__(), nzmath.rational.Rational.__mul__(), nzmath.rational.Rational.__pow__(), nzmath.rational.Rational.__radd__(), nzmath.rational.Rational.__rmul__(), nzmath.rational.Rational.__rsub__(), nzmath.rational.Rational.__rtruediv__(), nzmath.rational.Rational.__sub__(), nzmath.rational.Integer.__sub__(), nzmath.rational.Rational.__truediv__(), nzmath.rational.Rational.compare(), and nzmath.rational.Rational.expand().
nzmath.rational.theIntegerRing = IntegerRing() |
Definition at line 927 of file rational.py.
nzmath.rational.theRationalField = RationalField() |
Definition at line 928 of file rational.py.