Article View: uk.education.maths
Article #79Re: Pi day
From: Glenn Baddeley
Date: Fri, 04 Apr 1997 00:00
Date: Fri, 04 Apr 1997 00:00
35 lines
2132 bytes
2132 bytes
Chris Dearlove wrote: > A colleague described to me once a problem he once found (in someone > else's code, and not while he worked here) where pi had been accidentally > coded to too few places. (In some Fortran - all the places were there, > the "D0" after the "3.1415926535..." was missing). This caused a noticeable > ripple (maybe 140 dB down) when numerically simulating a signal of some > sort. This was sufficiently large to matter. > > Of course here just a few more digits would have been enough, maybe 10 > would have done. (I have seen cases where a few more than that are a > good idea in general precision requirements.) Pi as a constant in a program can be accurately assigned during initialisation by calculation rather than coding the digits. eg. Pi = arctan(1) * 4 Just make sure the real precision of the variable and arctan function is sufficient. eg. In Visual Basic dim Pi as double Pi = atn(1) * 4 Print Pi 3.14159265358979 This is the atn() example in the Language Reference book! HTH, Glenn.
Technical Details
Message-ID:
<3345643F.3D51@vitgssw.telecom.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8WRuzAAXBILzEwKP@ward-hull.demon.co.uk> <5gmqsn$bs8@milo.vcn.bc.ca> <AF5DA45C96685884D@sofluc.demon.co.uk> <ant262248d076Quo@cartmell.demon.co.uk> <5heh6s$ooa@raven.cc.ukans.edu> <5hrap4$ec9$1@miranda.gmrc.gecm.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f458d,30fff994c7ddd7d9 X-Google-Attributes: gidf458d,public X-Google-Thread: 109d8a,30fff994c7ddd7d9 X-Google-Attributes: gid109d8a,public X-Google-Thread: 1130d6,30fff994c7ddd7d9 X-Google-Attributes: gid1130d6,public X-Google-Thread: 1077c2,30fff994c7ddd7d9 X-Google-Attributes: gid1077c2,public X-Google-Thread: f7972,30fff994c7ddd7d9 X-Google-Attributes: gidf7972,public X-Google-Thread: 10d67e,30fff994c7ddd7d9 X-Google-Attributes: gid10d67e,public From: Glenn Baddeley <gbaddele@vitgssw.telecom.com.au> Subject: Re: Pi day Date: 1997/04/04 Message-ID: <3345643F.3D51@vitgssw.telecom.com.au> X-Deja-AN: 230563053 References: <8WRuzAAXBILzEwKP@ward-hull.demon.co.uk> <5gmqsn$bs8@milo.vcn.bc.ca> <AF5DA45C96685884D@sofluc.demon.co.uk> <ant262248d076Quo@cartmell.demon.co.uk> <5heh6s$ooa@raven.cc.ukans.edu> <5hrap4$ec9$1@miranda.gmrc.gecm.com> Organization: Telstra Newsgroups: uk.education.maths,alt.uu.math.misc,aus.mathematics,can.schoolnet.math.sr,alt.math.recreational,sci.math