Changes between Version 4 and Version 5 of Ticket #14567


Ignore:
Timestamp:
05/18/13 12:54:09 (7 years ago)
Author:
vdelecroix
Comment:

The last patch still does not implement a proper function to compute numerical approximations. It would be interesting to add one...

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14567 – Description

    v4 v5  
    88 6. there is no bridge with words (sage.combinat.words)
    99
    10 The patch proposed here develop some general design for dealing with continued fractions and solves the issues 1, 2, 3 and 5 (and I hope 4); see the discussion below.
     10The patch proposed here develop some general design for dealing with continued fractions and solve all issues above except 4 and 6; see the discussion below.
    1111
    1212With the patch applied we can do
     
    1414sage: (117/253).continued_fraction()
    1515[0; 2, 6, 6, 3]
     16
    1617sage: K.<sqrt2> = QuadraticField(2)
    1718sage: cff = (sqrt2/3 + 1/4).continued_fraction(); cff
    1819[0; 1, (2, 1, 1, 2, 3, 2, 1, 1, 2, 5, 1, 1, 14, 1, 1, 5)*]
     20sage: cff.period()
     21(2, 1, 1, 2, 3, 2, 1, 1, 2, 5, 1, 1, 14, 1, 1, 5)
     22sage: cff.preperiod()
     23(0, 1)
    1924sage: cff.value()
    20251/3*sqrt2 + 1/4
     26
     27sage: cf_pi = continued_fraction(pi)
     28[3; 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2, 2, 2, ...]
     29sage: cf_pi.quotient(1500)
     301
    2131}}}
    2232In particular we solve the question in #11345.