Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70684 > unrolled thread

Re: Significant digits in a float?

Started byChris Angelico <rosuav@gmail.com>
First post2014-04-29 02:28 +1000
Last post2014-04-28 11:31 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Significant digits in a float? Chris Angelico <rosuav@gmail.com> - 2014-04-29 02:28 +1000
    Re: Significant digits in a float? Roy Smith <roy@panix.com> - 2014-04-28 11:31 -0700

#70684 — Re: Significant digits in a float?

FromChris Angelico <rosuav@gmail.com>
Date2014-04-29 02:28 +1000
SubjectRe: Significant digits in a float?
Message-ID<mailman.9551.1398702541.18130.python-list@python.org>
On Tue, Apr 29, 2014 at 2:00 AM, Roy Smith <roy@panix.com> wrote:
> I have a bunch of floating point values.  For example, here's a few (printed as reprs):
>
> 38.0
> 41.2586
> 40.75280000000001
> 49.25
> 33.795199999999994
> 36.837199999999996
> 34.1489
> 45.5
>
> Fundamentally, these numbers have between 0 and 4 decimal digits of precision...

Terminology question: Why do you count only what's after the decimal
point? I would describe these as having between 2 and 6 significant
figures. Will they always have two digits before the decimal, or does
your precision really care only about what's after it?

Of course, there would still remain the problem of describing 49.25
with 6 sig figs, in the same way that it's hard to explain to someone
that you really do need to leave in five minutes (but if you said you
had to leave in six minutes, they'd believe you to be accurate to the
minute). But I assume that's not part of the question.

ChrisA

[toc] | [next] | [standalone]


#70686

FromRoy Smith <roy@panix.com>
Date2014-04-28 11:31 -0700
Message-ID<3368085f-e841-4ba1-a37e-12bae8d58746@googlegroups.com>
In reply to#70684
On Monday, April 28, 2014 12:28:59 PM UTC-4, Chris Angelico wrote:

> Terminology question: Why do you count only what's after the decimal
> point? I would describe these as having between 2 and 6 significant
> figures. Will they always have two digits before the decimal, or does
> your precision really care only about what's after it?

Hmmm, yeah, I was being sloppy in my description.  Definitely would have gotten points off in physics class for being so sloppy :-)

No, there's not always two digits before the decimal.  Could be anywhere from 0 to 3 digits before. What I'm really after is how many digits are after the decimal point.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web