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

## 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()

## Detailed Description

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

## ◆ continued_fraction_expansion()

 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__().

## ◆ 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 rational.py.

## ◆ isIntegerObject()

 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.

## ◆ theIntegerRing

 nzmath.rational.theIntegerRing = IntegerRing()

Definition at line 927 of file rational.py.

## ◆ theRationalField

 nzmath.rational.theRationalField = RationalField()

Definition at line 928 of file rational.py.