Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder5.news.weretis.net!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'numeric': 0.07; 'python': 0.08; 'precision': 0.09; 'scientists': 0.09; 'am,': 0.14; 'wrote:': 0.14; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'precision,': 0.16; 'subject:Fibonacci': 0.16; 'tue,': 0.17; 'header:In-Reply-To:1': 0.21; 'assume': 0.23; 'received:209.85.210.174': 0.23; 'received :mail-iy0-f174.google.com': 0.23; 'fri,': 0.23; "doesn't": 0.25; 'charset:iso-8859-7': 0.25; 'message-id:@mail.gmail.com': 0.28; 'be.': 0.29; "won't": 0.30; 'done': 0.32; 'steven': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'it?': 0.33; 'chris': 0.34; 'that,': 0.34; '-0700,': 0.35; "d'aprano": 0.35; 'received:google.com': 0.37; 'received:209.85': 0.37; '20,': 0.37; 'but': 0.38; 'data': 0.38; 'subject:: ': 0.38; "i'd": 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'unlimited': 0.67; 'floats.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=3xpY6E1U67eaSHTS4vRSeWQabKaOZhp6BcLDmQlGdbM=; b=jWSg6CmnHAeg45ysPlYerjoIhUtHWsepv0zc7upThIsMgFJ6aT2wSG750NcVwwOO/l LYxpmTO7EKiAPLYn/ngaZUnkveZ1WQ7jnrpZPwn+vH5tTu4mvgVDsxuvKqRuzy8Qc88I VOe2LbUsjFaPE2V2d3wgf1g2VDpkY7owN62Bg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Czi6SDsUHnqgsvGW2JlwmPrVFGAm3D9PWW2F8IQxNYCSnrLDqcRy9esHHtCG3prOf6 odJZTvvh9Rxst2QNm1Bz3br+v0/kTwOKM9WNVloCfV6koFT2GO5nFVhKzn20HA3dQ/px jF0QYyVZMjwvgIsC32wY4H5HxzzuKanQwEBbk= MIME-Version: 1.0 In-Reply-To: <4dd59e1e$0$29996$c3e8da3$5496439d@news.astraweb.com> References: <108ce447-10fa-4cf7-84ef-440ee18dbfd4@22g2000prx.googlegroups.com> <9d9c163b-14fd-4131-81bb-105c3b97c432@h36g2000pro.googlegroups.com> <4dd59e1e$0$29996$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 20 May 2011 09:37:59 +1000 Subject: Re: Faster Recursive Fibonacci Numbers From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305848282 news.xs4all.nl 49045 [::ffff:82.94.164.166]:35900 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5795 On Fri, May 20, 2011 at 8:47 AM, Steven D'Aprano wrote: > On Tue, 17 May 2011 10:02:21 -0700, geremy condra wrote: > >> or O(1): >> >> =F6 =3D (1 + sqrt(5)) / 2 >> =A0 =A0 numerator =3D (=F6**n) - (1 - =F6)**n > > I'd just like to point out that, strictly speaking, it's only O(1) if you > assume that exponentiation is O(1). Computer scientists often like to > make this simplifying assumption, and it might even be true for floats, > but for long ints and any numeric data types with unlimited precision, it > won't be. > Python doesn't have arbitrary precision non-integers, does it? So this is going to be done with floats. Chris Angelico