Significant figures calculation

Erik Max Francis max at alcyone.com
Tue Jun 28 14:59:53 EDT 2011


Steven D'Aprano wrote:
> On Tue, 28 Jun 2011 01:16 pm Chris Angelico wrote:
> 
>> On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
>> <steve+comp.lang.python at pearwood.info> wrote:
>>> Zero sig figure: 0
>>>
>> Is 0.0 one sig fig or two? (Just vaguely curious. Also curious as to
>> whether a zero sig figures value is ever useful.)
> 
> Two. I was actually being slightly silly about zero fig figures.
> 
> Although, I suppose, if you genuinely had zero significant figures, you
> couldn't tell what the number was at all, so you'd need to use a NaN :)

No, values with zero significant figures are just order of magnitude 
estimates.  They're used fairly often when doing very vague estimates, 
but obviously they're subject to pretty atrocious rounding error.

For instance, let's do an order of magnitude estimate for the Planck 
energy.  The most obvious method is to start with the Planck mass.  In 
SI, it's about 2 x 10^-8 kg, or on the order of 10^-8 kg (zero 
significant figures).  To convert to energy, multiply by c^2.  c = 3 x 
10^8 m/s, so c^2 = 9 x 10^16 m^2/s^2, or about 10^17 m^2/s^2, so the 
Planck energy is on the order of 10^9 J.  That's a calculation to zero 
significant figures.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis
   Love is the selfishness of two persons.
    -- Antoine de la Salle



More information about the Python-list mailing list