Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.032 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'correct,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'examples:': 0.16; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrong).': 0.16; 'zero,': 0.16; 'discussion': 0.18; 'later': 0.20; '(in': 0.22; 'header:User- Agent:1': 0.23; 'post': 0.26; 'header:X-Complaints-To:1': 0.27; 'correct': 0.29; '(which': 0.31; "d'aprano": 0.31; 'decimal': 0.31; 'evil': 0.31; 'pascal': 0.31; 'religious': 0.31; 'steven': 0.31; 'writes:': 0.31; 'core': 0.34; 'maybe': 0.34; 'could': 0.34; 'problem': 0.35; 'one,': 0.35; 'but': 0.35; 'described': 0.36; 'impression': 0.36; 'subject:?': 0.36; 'ben': 0.38; 'to:addr :python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'such': 0.63; 'places': 0.64; 'more': 0.64; 'here': 0.66; '8bit%:21': 0.69; 'stated': 0.69; 'ending': 0.78; 'yourself': 0.78; 'received:125': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Significant digits in a float? Date: Tue, 29 Apr 2014 13:23:07 +1000 References: <535f0f9f$0$29965$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:VVi/5c48wtKrGPMo6KNKHyu+zlE= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1398741802 news.xs4all.nl 2914 [2001:888:2000:d::a6]:45668 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:70703 Steven D'Aprano writes: > By the way, you contradict yourself here. Earlier, you described 38.0 as > having zero decimal places (which is wrong). Here you describe it as > having one, which is correct, and then in a later post you describe it as > having zero decimal places again. I get the impression that this is at the core of the misunderstanding. Having a number's representation ending in “….0” does not mean zero decimal places; it has exactly one. The value's representation contains the digit “0” after the decimal point, but that digit is significant to the precision of the representation. If the problem could be stated such that “38.0” and “38” and “38.000” are consistently described with the correct number of decimal digits of precision (in those examples: one, zero, and three), maybe the discussion would make more sense. -- \ “Men never do evil so completely and cheerfully as when they do | `\ it from religious conviction.” —Blaise Pascal (1623–1662), | _o__) Pensées, #894. | Ben Finney