Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed3.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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'value,': 0.04; 'binary': 0.07; 'subject:bug': 0.07; 'string': 0.09; '*is*': 0.09; 'cc:addr :python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'surprises': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'comfortable': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'appear': 0.29; 'message- id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'decimal': 0.31; 'steven': 0.31; 'quite': 0.32; 'except': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'pm,': 0.38; 'guarantee': 0.63; '26,': 0.68; 'subject': 0.69; 'limit': 0.70; 'obvious': 0.74; 'divide': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=JTsc1r8qibhrOZEIroGymK7RMKZdWyzBZHi0uvWAfVI=; b=pPXceBkDsYt+2lpXEzKchQkQ9AaUP6gzMLwhydNnfmWS3s/OMq9FNelSLjH3+NbRGn E4GMrXmjUwUh27HztoB+pDyY9/g4ecew10rug7UolSO0gi0feFe3vIeFFcTa5EqpTEqH M7eiNkWRt5BHkGPW4IL1vweGceIyg9eSuqVE1jTIlVWNBgNl0G9XQYTYNW/gNVLBRQ3N n5jr2mo+dQMwrv5AMqNw1nek0afAtbbRo6oxLjAFQB3a0kK98EQg4UO1AaR74emP6gda txgUaTjiO6o9cpsedfJFyDnbMg7oDucknsSgvxB7SfjkuZsa9Vc9w+0vazUkzBury7fv JYDw== MIME-Version: 1.0 X-Received: by 10.58.56.102 with SMTP id z6mr10336916vep.7.1403752425637; Wed, 25 Jun 2014 20:13:45 -0700 (PDT) In-Reply-To: <53ab8bc4$0$11121$c3e8da3@news.astraweb.com> References: <645be4a7-2e1b-44a4-9c45-9184c6df5518@googlegroups.com> <53ab8bc4$0$11121$c3e8da3@news.astraweb.com> Date: Thu, 26 Jun 2014 13:13:45 +1000 Subject: Re: python 3.44 float addition bug? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1403752434 news.xs4all.nl 2907 [2001:888:2000:d::a6]:46028 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73602 On Thu, Jun 26, 2014 at 12:56 PM, Steven D'Aprano wrote: > That's a myth. decimal.Decimal *is* a floating point value, and is > subject to *exactly* the same surprises as binary floats, except for one: > which Decimal, you can guarantee that any decimal string you enter will > appear exactly the same (up to the limit of the current precision). The important difference is that the issues with decimal floats come where humans are comfortable seeing them. If you divide 1 by 3, you get 0.333333333 and can understand that adding three of those together won't quite make 1.0, because you can see that you shortened it. If you divide 11 by 10, it's not obvious that that repeats. ChrisA