NZMATH  1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
  Fossies Dox: NZMATH-1.2.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

nzmath.rational Namespace Reference


class  Integer
class  IntegerRing
class  Rational
class  RationalField


def isIntegerObject (anObject)
def IntegerIfIntOrLong (anObject)
def continued_fraction_expansion (target, terms)


 theIntegerRing = IntegerRing()
 theRationalField = RationalField()

Detailed Description

rational module provides Rational, Integer, RationalField, and IntegerRing.

Function Documentation

◆ continued_fraction_expansion()

def nzmath.rational.continued_fraction_expansion (   target,
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

References nzmath.bigrange.range().

Referenced by nzmath.rational.Rational.__init__().

◆ IntegerIfIntOrLong()

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

◆ isIntegerObject()

Variable Documentation

◆ theIntegerRing

nzmath.rational.theIntegerRing = IntegerRing()

Definition at line 927 of file

◆ theRationalField

nzmath.rational.theRationalField = RationalField()

Definition at line 928 of file