Significant digits in a float?

Roy Smith roy at panix.com
Tue Apr 29 19:53:57 EDT 2014


In article <mailman.9575.1398789020.18130.python-list at python.org>,
 Chris Angelico <rosuav at gmail.com> wrote:

> On Tue, Apr 29, 2014 at 11:38 PM, Roy Smith <roy at panix.com> wrote:
> > I'm trying to intuit, from the values I've been given, which coordinates
> > are likely to be accurate to within a few miles.  I'm willing to accept
> > a few false negatives.  If the number is float("38"), I'm willing to
> > accept that it might actually be float("38.0000"), and I might be
> > throwing out a good data point that I don't need to.
> 
> You have one chance in ten, repeatably, of losing a digit. That is,
> roughly 10% of your four-decimal figures will appear to be
> three-decimal, and 1% of them will appear to be two-decimal, and so
> on. Is that "a few" false negatives?

You're looking at it the wrong way.  It's not that the glass is 10% 
empty, it's that it's 90% full, and 90% is a lot of good data :-)



More information about the Python-list mailing list