Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Bug in Decimal?? Date: Wed, 30 Apr 2014 19:59:46 +1200 Lines: 13 Message-ID: References: <973d2677-03c6-464a-8c88-f07282806468@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net G9OV5XndrTt2gT7o3Q7qZA6yRT1HYmDQsDWgbQz5K1iTV1bkQq Cancel-Lock: sha1:YXVLyVSsaTtYhjRsXYVPkKBuRDU= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <973d2677-03c6-464a-8c88-f07282806468@googlegroups.com> Xref: csiph.com comp.lang.python:70766 pleasedontspam@isp.com wrote: > I compared the results with wolfram Alpha, and > also with an open source arbitrary precision calculator, which matches Alpha > results. Decimal is *not* an arbitrary precision data type, so you can't expect exact results from it. You can set the precision to be very large, but it's still essentially a floating point type, and as such you can expect the last few digits to depend heavily on the details of the algorithm used. -- Greg