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 14:36:46 +1000 Lines: 21 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> <57846fdb$0$1593$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Z2ycICsNLQY8cNQY5++sCwxu+dg59Ejg00eKZRBhwNzA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'granted,': 0.07; 'subject:number': 0.07; 'cc:addr:python-list': 0.09; 'subject: \n ': 0.15; '2016': 0.16; 'digits.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nonzero': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'say,': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'header :In-Reply-To:1': 0.24; "doesn't": 0.26; 'example': 0.26; 'chris': 0.26; 'point.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'decimal': 0.29; "d'aprano": 0.33; 'steven': 0.33; 'tue,': 0.34; 'received:google.com': 0.35; 'but': 0.36; 'there': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; '12,': 0.37; 'represent': 0.38; 'end': 0.39; 'subject:-': 0.39; 'close': 0.61; 'more': 0.63; 'jul': 0.72; 'chrisa': 0.84; 'to:none': 0.91 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; bh=d/fDuBeuorLuRWhDzD/u++fZN1Aw7tv10xXsoT34w6M=; b=yhMaynarfOInhU6JVicadWJTUKirJnF5RimUnvMe8cTAdGJKJmhnPd9uk1SCzvKkMK psTqqhFVtv6ZLCDSBHJ6V2umZdPfp5voqyq2tqGT2NYkTGlbhQTpbQDfOBXJ/lkZJem+ 8sZuBIY/411bozWiBHeCxZIXt2OmBO50ZChYzdApC18xn2eQAOMt89wSZ6doMY/DfQAh L0rLHlJfsZDN+7/yJ/oPst50ya1OB3ZsroTZESR2SsWe+pb74UtutJq8GqtMYoCPvyVf y8DJjibQsGZwZKLMVr2LeXdn6BiNmUshb7kKOPdEjtZAuoSuJJnu6g+Q//j2SHVvS+Ur iqQg== 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; bh=d/fDuBeuorLuRWhDzD/u++fZN1Aw7tv10xXsoT34w6M=; b=QQ66k+nT0Ew8Gdc+GuxCgXdrOdmy14RvPsaoufiZJSpISlSPS5qut+ojkDvrYqCxHw QBT6DjrjpsN6dulXNDhDRfHR5nkAztnb0TkaL1O3SETbVgSDVT2O0A6hwNSnOcvubIec Cz97xwZoK5sdbsReJRqN7ysBbdC+8VheuYzHzxk7ZfEAakUzyAAmm02ViNP7/wwwa9xh x/ZQyXrhPynie+17ontV0zQe3ybVWJ7HGsLxG84T9rGkC3h+fD3V1T7f+YOlZwfGw+/s rNUJHgpiSceCLRiJpQPTSd+135uSLLvQ4L0ZJsctoLHtD6K8SBnKTB2i7VKdzBdt5jgF Zp6w== X-Gm-Message-State: ALyK8tLZmwQS2JRXNH594A95PuynKP/JLyD7Kuon4rHA+eb6smeepjwWRcE2FCPTw7S0f24Cau9xJ0nub2JRKQ== X-Received: by 10.28.144.80 with SMTP id s77mr18201061wmd.41.1468298206634; Mon, 11 Jul 2016 21:36:46 -0700 (PDT) In-Reply-To: <57846fdb$0$1593$c3e8da3$5496439d@news.astraweb.com> 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> <57846fdb$0$1593$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:111317 On Tue, Jul 12, 2016 at 2:19 PM, Steven D'Aprano wrote: > On Tue, 12 Jul 2016 07:51 am, Chris Angelico wrote: > >> say, 2,147 >> millimeters, with a precision of four significant digits > > > How do you represent 1 mm to a precision of four significant digits, in such > a way that it is distinguished from 1 mm to one significant digit, and 1 mm > to a precision of four decimal places? > > 0001 > 1 > 1.0000 Exactly my point. Granted, I mucked up my example (subtraction doesn't maintain sig figs - apologies, my bad), but there are other ways to end up with numbers close to zero with more sig figs than nonzero digits. ChrisA