On Thu, 28 Jan 2010 at 04:21AM -0800, ablondin wrote:
> Hello, everyone,
> I would like to create a real number from its continued fraction
> expansion. I know it is possible to call ``CFF([0,1,1,1,1,1,1]).value()
> `` to have an approximation of the golden ratio, but I would like to
> pass an iterator as an argument to the function ``CFF(...)`` so that I
> can get a real number ``x`` represented by its continued fraction
> expansion. As a consequence, for instance, I could get an arbitrary
> precision about its digits by calling something like ``x.value(bits=50)
> ``.
> Does it already exist in Sage ? Or do I need to create such a
> function ? Thank you !

I think you'll need to create the function. I'd like to see something
like that in Sage; it would be nice to create the golden ratio with

def f():
    yield 0
    while True:
        yield 1

CFF(f())


Dan

-- 
---  Dan Drake
-----  http://mathsci.kaist.ac.kr/~drake
-------

Attachment: signature.asc
Description: Digital signature

Reply via email to