Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #93437
| Path | csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.007 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; '__future__': 0.09; 'oh,': 0.09; 'subject:skip:m 10': 0.09; 'python': 0.11; 'anyway': 0.11; 'thu,': 0.15; 'division,': 0.16; 'threw': 0.16; 'wrote:': 0.16; 'integer': 0.18; 'runs': 0.18; '2.x': 0.22; 'am,': 0.23; '2015': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'paul': 0.24; 'message-id:@mail.gmail.com': 0.28; 'fedora': 0.29; 'error.': 0.31; 'possibly': 0.32; 'problem': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'received:google.com': 0.34; 'to:addr:python- list': 0.35; 'but': 0.36; 'subject:: ': 0.37; 'test': 0.39; 'to:addr:python.org': 0.39; 'well.': 0.40; 'jul': 0.72; 'to:name:python': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=acPjqw3/KNKLn5l++imhM7sHmYQsEPwooeX3KnIgs0c=; b=AVj7sbXi3YuCMzH//ffTytAb8Tmt3GHz14tABqTEBaJzT8mPxX8uYunOdtCSd7yiNt F4EIj26ni7tFHZfiRpm7e6XXFZ75aAwjEO82rys7erbRtvgSZFtZor1xvP4BiSgdRGlR 0l1fTldsJBIx/1CyJSV7xCOMzFpSki52GC9aXYt13lovJw/gutW+dYcjrrw0hYBI05H4 t62kZsyGONlHes4AIfLvqMcrNpG+KY9cFinMslvjLgPnzH3LwMazs05jL6sz1zMRiP7/ BZ9bSGaqo9rggaApzrJGTe3ZTWInNMBOhM8huMszIV2pha3fNqLwXq5jeYOhXd4/vIOk iPBA== |
| X-Received | by 10.170.83.213 with SMTP id z204mr36851841ykz.63.1435851523214; Thu, 02 Jul 2015 08:38:43 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <87a8vepomp.fsf@nightsong.com> |
| References | <55955048$0$1662$c3e8da3$5496439d@news.astraweb.com> <87a8vepomp.fsf@nightsong.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Thu, 2 Jul 2015 09:38:03 -0600 |
| Subject | Re: Bug in floating point multiplication |
| To | Python <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.255.1435851526.3674.python-list@python.org> (permalink) |
| Lines | 11 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1435851526 news.xs4all.nl 2896 [2001:888:2000:d::a6]:39314 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:93437 |
Show key headers only | View raw
On Thu, Jul 2, 2015 at 9:26 AM, Paul Rubin <no.email@nospam.invalid> wrote: > Steven D'Aprano <steve@pearwood.info> writes: >> x = 1 - 1/2**53 >> assert x == 0.9999999999999999 > > In Python 2.x I don't see how that assert can possibly succeed, since > x is the integer 1. But I tested it anyway on 2.7.5 under Fedora 19 > and it threw an assertion error. Oh, duh. That was the problem on my 2.7.6 test as well. I added from __future__ import division, and now it runs to completion.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Bug in floating point multiplication Steven D'Aprano <steve@pearwood.info> - 2015-07-03 00:52 +1000
Re: Bug in floating point multiplication Michael Poeltl <michael.poeltl@univie.ac.at> - 2015-07-02 17:10 +0200
Re: Bug in floating point multiplication Chris Angelico <rosuav@gmail.com> - 2015-07-03 01:21 +1000
Re: Bug in floating point multiplication Robin Becker <robin@reportlab.com> - 2015-07-02 16:24 +0100
Re: Bug in floating point multiplication Paul Rubin <no.email@nospam.invalid> - 2015-07-02 08:26 -0700
Re: Bug in floating point multiplication Chris Angelico <rosuav@gmail.com> - 2015-07-03 01:34 +1000
Re: Bug in floating point multiplication Steven D'Aprano <steve@pearwood.info> - 2015-07-03 01:41 +1000
Re: Bug in floating point multiplication Ian Kelly <ian.g.kelly@gmail.com> - 2015-07-02 09:38 -0600
Re: Bug in floating point multiplication Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2015-07-02 17:15 +0200
Re: Bug in floating point multiplication Ian Kelly <ian.g.kelly@gmail.com> - 2015-07-02 09:28 -0600
Re: Bug in floating point multiplication Robin Becker <robin@reportlab.com> - 2015-07-02 16:29 +0100
Re: Bug in floating point multiplication Ian Kelly <ian.g.kelly@gmail.com> - 2015-07-02 09:32 -0600
Re: Bug in floating point multiplication Steven D'Aprano <steve@pearwood.info> - 2015-07-03 01:42 +1000
Re: Bug in floating point multiplication duncan smith <buzzard@invalid.invalid> - 2015-07-02 17:08 +0100
Re: Bug in floating point multiplication MRAB <python@mrabarnett.plus.com> - 2015-07-02 17:20 +0100
Re: Bug in floating point multiplication Tim Chase <python.list@tim.thechases.com> - 2015-07-02 11:59 -0500
Re: Bug in floating point multiplication Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-07-02 19:49 +0200
Re: Bug in floating point multiplication Ned Deily <nad@acm.org> - 2015-07-02 22:07 -0700
Re: Bug in floating point multiplication Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-07-03 18:27 +0200
Re: Bug in floating point multiplication Laurent Pointal <laurent.pointal@free.fr> - 2015-07-02 23:12 +0200
Re: Bug in floating point multiplication Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-07-03 16:13 +0100
Re: Bug in floating point multiplication Laura Creighton <lac@openend.se> - 2015-07-05 00:54 +0200
Re: Bug in floating point multiplication Peter Otten <__peter__@web.de> - 2015-07-05 09:38 +0200
csiph-web