Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'skip:[ 20': 0.03; 'true,': 0.04; 'binary': 0.05; 'removes': 0.05; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; "wouldn't": 0.11; 'subject:python': 0.11; '"from': 0.16; '3.2.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wrote:': 0.17; 'jan': 0.18; '>>>': 0.18; 'import': 0.21; 'claimed': 0.22; 'least': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'header:X -Complaints-To:1': 0.28; 'author,': 0.29; 'decimal': 0.29; 'factor': 0.29; "i'm": 0.29; 'doubt': 0.33; 'largely': 0.33; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'skip:t 40': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'sincerely': 0.60; 'within': 0.64; 'subjectcharset:utf-8': 0.72; '100': 0.78; 'subject:get': 0.81; 'float,': 0.84; 'received:fios.verizon.net': 0.84; 'subject:value': 0.84; 'angel': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: =?UTF-8?B?UmU6IFRvIGdldCB0aGUgYWNjdXJhdGUgdmFsdWUgb2YgMSAtIDAuOTk=?= =?UTF-8?B?OTk5OTk5OTk5OTk5OSAsaG93IHRvIGltcGxlbWVudCB0aGUgcHl0aG9uIGFsZ28=?= =?UTF-8?B?cml0aG0g77yf?= Date: Mon, 08 Oct 2012 21:45:16 -0400 References: <91ff9b33-c212-4be0-8ed0-1f6b16f56865@googlegroups.com> <5072E7CC.2070405@davea.name> <5072EDA6.6040202@davea.name> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: <5072EDA6.6040202@davea.name> 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349747148 news.xs4all.nl 6897 [2001:888:2000:d::a6]:53131 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30982 On 10/8/2012 11:13 AM, Dave Angel wrote: >> Isn't it true, though, that Python 3.3 has a completely new >> implementation of decimal that largely removes this disadvantage? > I wouldn't know, I'm on 3.2. However, I sincerely doubt if it's within > a factor of 100 of the speed of the binary float, at least on >>> import timeit as tt >>> tt.repeat("float('1.0')-float('0.9999999999')") [0.6856039948871151, 0.669049830953858, 0.668688006423692] >>> tt.repeat("Decimal('1.0')-Decimal('0.9999999999')", "from decimal import Decimal") [1.3204655578092428, 1.286977575486688, 1.2893188292009938] >>> tt.repeat("a-b", "a = 1.0; b=0.9999999999") [0.06100386171601713, 0.044538539999592786, 0.04451548406098027] >>> tt.repeat("a-b", "from decimal import Decimal as D; a = D('1.0'); b = D('0.9999999999')") [0.14685526219517442, 0.12909696344064514, 0.12646059371189722] A factor of 3, as S. Krah, the cdecimal author, claimed -- Terry Jan Reedy