Main Overview

Class ContFrac

ContFrac(number, steps=5)
Continued fraction from number with maximal length steps
Example:
ContFrac(pi, 3) returns ContFrac(3, 7, 15).
This represent the number 3 + 1/(7 + 1/15).

Overview:

Constructor

ContFrac (number, steps=5)

Operators

OperatorMeaning
str(x)

Object Methods

MethodMeaning
toRational (n=0)Rational number defined by the first n list elements

Constructor

ContFrac

Constructor

Usage: ContFrac(number, steps=5)


Operators

str(x)

Object representation as string

Usage: str(x)

Description:


Object Methods

toRational

toRational(n=0)

Usage: self.toRational(n=0)

Description:
Rational number defined by the first n list elements
Converts the continued fraction int a rational number.
Example:
ContFrac(pi).toRational(2) returns 22/7.