Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'true,': 0.04; 'removes': 0.05; 'python': 0.09; 'subject:python': 0.11; '1:48': 0.16; 'ah,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'oct': 0.16; 'wrote:': 0.17; 'import': 0.21; 'received:209.85.214.174': 0.21; 'machine': 0.24; 'header:In- Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'decimal': 0.29; 'class': 0.29; 'largely': 0.33; 'to:addr :python-list': 0.33; 'skip:d 20': 0.34; 'received:google.com': 0.34; 'received:209.85': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'subjectcharset:utf-8': 0.72; 'subject:get': 0.81; 'copy-paste': 0.84; 'subject:value': 0.84; 'angel': 0.93 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:to :content-type; bh=LmVVfU2OOChksh6QoxpffBM3s08Ki0PXIewHVRepvDQ=; b=u6YtwPMMkHXExNr6SpKDcYBeCPu4XGKzW2/5efcuUk/YQaFh1R0iA8KDSqQHocsdvH QgBoXVtJn2GbMzFnXmqHqiRNAbrl/7T7orEV/GFfnWE2fcIJ+zS6MdaupjmDPtlBkrRU kKwA5390gUNh9Umh4XT47W6BgxUXPbYvrIQn5JYCvWz0K+M52ukBYZSitE3Rs2Vq8CrQ R9y+zQosJVesxPfJMUV7fAS86hBKnIlw64Lo3QLzBiAnrXN5Dbngx8QtWmSS0iZna4qn l3vGbBAaR8Iy7M0fpNtYl7v8c683epHqRG9BOA2H5/fQOTQRq4RPOiZYnqKfzcIZ5IPA d16w== MIME-Version: 1.0 In-Reply-To: <5072E7CC.2070405@davea.name> References: <91ff9b33-c212-4be0-8ed0-1f6b16f56865@googlegroups.com> <5072E7CC.2070405@davea.name> Date: Tue, 9 Oct 2012 02:00:04 +1100 Subject: =?UTF-8?Q?Re=3A_To_get_the_accurate_value_of_1_=2D_0=2E9999999999999?= =?UTF-8?Q?99_=2Chow_to_implement_the_python_algorithm_=EF=BC=9F?= From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349708407 news.xs4all.nl 6843 [2001:888:2000:d::a6]:35876 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30961 On Tue, Oct 9, 2012 at 1:48 AM, Dave Angel wrote: > import decimal > a = decimal.Decimal(4.3) > print(a) > > 5.0999999999999996447286321199499070644378662109375 Ah, the delights of copy-paste :) > The Decimal class has the disadvantage that it's tons slower on any modern machine I know of... Isn't it true, though, that Python 3.3 has a completely new implementation of decimal that largely removes this disadvantage? ChrisA