Fibonacci Sequence and Long numbers.
Aahz Maruch
aahz at panix.com
Mon Oct 16 12:34:20 EDT 2000
More information about the Python-list mailing list
Mon Oct 16 12:34:20 EDT 2000
- Previous message (by thread): Fibonacci Sequence and Long numbers.
- Next message (by thread): wxPython on IRIX6.5
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <m2wvf9avu7.fsf at hooft.net>, Rob Hooft <rob at hooft.net> wrote: >from math import sqrt > >def fib(n): > return ((0.5+0.5*sqrt(5.0))**n-(0.5-0.5*sqrt(5.0))**n)/sqrt(5.0) That's fast, but of course it doesn't scale as well as Python longs. -- --- Aahz (Copyright 2000 by aahz at pobox.com) Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/ Hugs and backrubs -- I break Rule 6 "Isn't it interesting that the same people who laugh at science fiction listen to weather forecasts and economists?" -- Kelvin Throop III
- Previous message (by thread): Fibonacci Sequence and Long numbers.
- Next message (by thread): wxPython on IRIX6.5
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list