Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '(especially': 0.07; 'precision': 0.09; 'pm,': 0.11; 'subject:error': 0.12; 'wrote:': 0.14; 'library': 0.15; 'coded': 0.16; 'curiosity,': 0.16; 'precision.': 0.16; 'algorithm': 0.16; 'subject:was': 0.16; 'math': 0.16; 'tue,': 0.20; 'header:In-Reply-To:1': 0.22; '(and': 0.22; 'memory': 0.24; "i'm": 0.26; 'chris': 0.27; 'message- id:@mail.gmail.com': 0.28; 'comment': 0.30; 'decimal': 0.31; 'to:addr:python-list': 0.32; '(for': 0.33; 'uses': 0.34; 'using': 0.34; 'that,': 0.35; 'implies': 0.35; 'rather': 0.36; 'received:209.85': 0.37; 'steven': 0.38; 'received:google.com': 0.38; 'anything': 0.38; 'to:addr:python.org': 0.39; 'could': 0.39; 'subject: (': 0.39; 'received:209': 0.39; 'how': 0.39; 'whatever': 0.39; 'would': 0.40; 'header:Received:5': 0.40; 'might': 0.40; 'performance.': 0.60; '2011': 0.62; 'double': 0.69; 'received:209.85.210.174': 0.84; 'received:mail- iy0-f174.google.com': 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; bh=9FthCRzbdSKk0RYRZfJglcXDlddmYNnfnTcsyyD99i4=; b=FzaPtmAeu5JEkxeh15OnVg3Dma0cT+pb4PyNX3Flfmf0nobn5V1w9ETI3DDh6RtXsT gjGOsStLxFWr4cGITa+aup1hkk5jSuRo9l0XHSCnV2VO/HEBGiRPhLOjE2jcDl4FCkin p6kb71X/2rxHH0ZLbeVC9ahpDWAm0m71aj6BI= 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; b=wq9W69Nfh4X0zmNbgZ90GKeQ40E/2WlzVaWe9yrM6yYdIf4TpYq6JnsldS/Ur3nQhs 9uE2/xuOPDQPBZO6+6k1OIzEiGyaKM7AEfUTQDRZvbafL61GYfpW4/LJOzCVOo78Ydr0 Fr0x3HdA/YcSUGD8YZGjaF/OqdSwxi2x5UIlM= MIME-Version: 1.0 In-Reply-To: <4dbff9ed$0$29991$c3e8da3$5496439d@news.astraweb.com> References: <0HFvp.18698$vT3.2042@newsfe06.iad> <6828b506-1e18-4bfa-85c0-caa830daf98a@j13g2000pro.googlegroups.com> <4DBFD9A6.1040803@ieee.org> <4dbff9ed$0$29991$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 3 May 2011 23:02:29 +1000 Subject: Re: Recursion or iteration (was Fibonacci series recursion error) From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 21 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1304427757 news.xs4all.nl 81474 [::ffff:82.94.164.166]:42010 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4539 On Tue, May 3, 2011 at 10:49 PM, Steven D'Aprano wrote: > On Tue, 03 May 2011 21:04:07 +1000, Chris Angelico wrote: > >> And that, Your Honour, is why I prefer bignums (especially for integers) >> to floating point. Precision rather than performance. > > I'm intrigued by your comment "especially for integers", which implies > that you might use bignums for non-integers. Out of curiosity, how would > you calculate: > > sin(sqrt(7)*pi/31) > > using bignums? REXX uses decimal bignums, although I don't have a high-performance math library (for sin) that uses anything more than IEEE double precision. If I coded my own sin algorithm in REXX, I could go to whatever precision memory (and patience) would allow. Chris Angelico