Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: What is precision of a number representation? (was: Curious Omission In New-Style Formats) Date: Tue, 12 Jul 2016 07:51:23 +1000 Lines: 39 Message-ID: References: <834b1cce-38dd-474c-8915-4ff1cd6b27ec@googlegroups.com> <7fcc8c21-106f-41d4-a5ba-409f3b54a56d@googlegroups.com> <5783c91e$0$1622$c3e8da3$5496439d@news.astraweb.com> <5783D63F.5040307@stoneleaf.us> <8560sbvqqd.fsf_-_@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de Qpsu6O7jV3EJRTjZDATrhQzW7puKG9AZsiw8RQMf0oIg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.089 X-Spam-Evidence: '*H*': 0.84; '*S*': 0.02; 'subject:number': 0.07; 'width': 0.07; 'cc:addr:python-list': 0.09; 'accuracy.': 0.09; 'subject: \n ': 0.15; '2016': 0.16; '6:56': 0.16; 'digits.': 0.16; 'fit,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'pace': 0.18; 'say,': 0.18; '(not': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'precise': 0.22; 'am,': 0.23; 'accuracy': 0.23; 'header:In-Reply-To:1': 0.24; 'figure': 0.27; 'message-id:@mail.gmail.com': 0.27; 'record': 0.29; 'measure': 0.29; 'maybe': 0.33; 'tue,': 0.34; 'this?': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'unit': 0.35; 'but': 0.36; 'depends': 0.36; 'subject:: ': 0.37; 'two': 0.37; '12,': 0.37; 'mean': 0.38; 'represent': 0.38; 'why': 0.39; 'does': 0.39; 'area': 0.39; 'subject:-': 0.39; 'some': 0.40; 'your': 0.60; 'is.': 0.63; 'skip:\xe2 10': 0.70; 'jul': 0.72; 'square': 0.76; 'low': 0.83; '(four': 0.84; '8bit%:77': 0.84; 'chrisa': 0.84; 'clearance': 0.84; 'fridge': 0.84; 'meters': 0.84; 'to:none': 0.91; 'distance.': 0.91; 'laser': 0.93; 'hundred': 0.96; 'hand,': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=T4G7v8fhjl08PoXlFWZxiKH2YudogLvzI53NLe72n0s=; b=vcG0I5VeKt5l20zNna8oS35fWLjYL2z7iLRrBJyhko+35QP2GvDBR6etjpL6bJMbqr J4to4Njn/5b4Jjtk77384n35lHJOuA+A52OHjfvp6VLhc42gj0r0QtBQ9aGJ9gXmBqQt Q3ZGd3iFHn3QpcCd8sBU3fvqYcGNW9VbfnXN1DgxeWLeMjOv4vVD+YQWTLeSDydP34gC 5nC/1nnNPpHUyIaZYzRfleR4qeTi0HK9G+Prl37VKBH3ti9AyFZmiDwqhBAaB8qSLh1/ FEWsfcewdK3AXAB2zwTZWTVDCc4ghgz2VRF2S/tKOtAl1RikuZweOPKQY+Xge+5TX5G9 uqlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=T4G7v8fhjl08PoXlFWZxiKH2YudogLvzI53NLe72n0s=; b=cdkyO6y7b7cWHGy5HI5Cm6Bhb1V592JaDawjDElcLbuMbqvm1V/vVPzR2Iqvqd0iiK /2ArSYB/Qm6jKniA7LEhgWADOHNMg2Zb9hhjuFUTcWnxVWNA2QcE0NmmDp35R02+dwov 4R0dlH0B+J7uyE23pxECXrdMFekNIvsuqxIgsm3dxt8RizprO/FFnoJlZJhR58kkg7j9 vFMdk5yCPLHBGqb8phI7Rl2jyRoYu1L03wKcOMV8svsvzbZlZqpkLXWZnUZcdNPX3UXA ec7GswyzBgVWdUQwcueUEWNaQvTQpZx/8P4mQBHvQlfGbAQA1ZT83YhTg01fiRGJfDnw qOXA== X-Gm-Message-State: ALyK8tLs88HUzKcEAlCPlAybpwAyQfezOcWRF0Wz2XrqMG4pQ+sEUcKnuieGiNbDL+S0Eh+UU+h4KPyq1AOlPw== X-Received: by 10.194.75.131 with SMTP id c3mr1592460wjw.117.1468273884287; Mon, 11 Jul 2016 14:51:24 -0700 (PDT) In-Reply-To: <8560sbvqqd.fsf_-_@benfinney.id.au> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <834b1cce-38dd-474c-8915-4ff1cd6b27ec@googlegroups.com> <7fcc8c21-106f-41d4-a5ba-409f3b54a56d@googlegroups.com> <5783c91e$0$1622$c3e8da3$5496439d@news.astraweb.com> <5783D63F.5040307@stoneleaf.us> <8560sbvqqd.fsf_-_@benfinney.id.au> Xref: csiph.com comp.lang.python:111297 On Tue, Jul 12, 2016 at 6:56 AM, Ben Finney wr= ote: > Precision is not a property of the number. It is a property of the > *representation* of that number. > > The representation =E2=80=9C1=C3=9710=C2=B2=E2=80=9D has a precision of o= ne digit. > The representation =E2=80=9C100=E2=80=9D has a precision of three digits. > The representation =E2=80=9C00100=E2=80=9D has a precision of five digits= . > The representation =E2=80=9C100.00=E2=80=9D also has a precision of five = digits. > > Those can all represent the same number; or maybe some of them represent > =E2=80=9Cone hundred=E2=80=9D and others represent =E2=80=9Cone hundred a= nd a millionth=E2=80=9D. > Yep. Precision is also a property of a measurement, the same way that a unit is. If I pace out the length of the main corridor in my house, I might come up with a result of thirty meters. The number is "30"; the unit is "meters", the precision is two significant digits, and the accuracy depends on how good I am at pacing distance. This is why it's important to be able to record precisions of arbitrary numbers. If I then measure the width of this corridor with a laser, I could get an extremely precise answer - say, 2,147 millimeters, with a precision of four significant digits, and excellent accuracy. But if I multiply those numbers together to establish the floor area of the corridor, the result does NOT have four significant figures. It would be 64 square meters (not 64.41), and the accuracy would be pretty low (effectively, the *in*accuracies of both measurements get combined). But on the other hand, if you want to know whether your new fridge will fit, you could measure it with the same laser and come up with a figure of 1,973 mm (four sig fig), which would mean your clearance is 174mm (four sig fig). How do you record this? Is it 174.0? 0174? "174 with four significant figures"? ChrisA