Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  Built-in Functions /  Mathematical Functions /  Number Theory /

ContinuedFraction

FilledSmallSquare ContinuedFraction[x, n] generates a list of the first n terms in the continued fraction representation of x.
FilledSmallSquare ContinuedFraction[x] generates a list of all terms that can be obtained given the precision of x.

FilledSmallSquare The continued fraction representation , , , ... corresponds to the expression .
FilledSmallSquare x can be either an exact or an inexact number.
FilledSmallSquare Example: ContinuedFraction[Pi, 4]LongRightArrow.
FilledSmallSquare For exact numbers, ContinuedFraction[x] can be used if x is rational, or is a quadratic irrational.
FilledSmallSquare For quadratic irrationals, ContinuedFraction[x] returns a result of the form , , ... , , , ... , corresponding to an infinite sequence of terms, starting with the , and followed by cyclic repetitions of the .
FilledSmallSquare Since the continued fraction representation for a rational number has only a limited number of terms, ContinuedFraction[x, n] may yield a list with less than n elements in this case.
FilledSmallSquare For terminating continued fractions, ... , k is always equivalent to ... , k-1, 1; ContinuedFraction returns the first of these forms.
FilledSmallSquare FromContinuedFraction[list] reconstructs a number from the result of ContinuedFraction.
FilledSmallSquare See The Mathematica Book on the web: Section 3.2.4.
FilledSmallSquare Implementation Notes: see section A.9.4.
FilledSmallSquare See also: FromContinuedFraction, IntegerDigits, Rationalize, RealDigits.