Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3a.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; 'alain': 0.09; 'here?': 0.09; 'overflow': 0.09; 'undefined': 0.09; 'cc:addr:python-list': 0.11; "didn't,": 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'i.e.,': 0.16; 'negative,': 0.16; 'overflow.': 0.16; 'subject:search': 0.16; 'unsigned': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'signed': 0.27; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'received:google.com': 0.35; 'there': 0.35; 'false': 0.36; 'in:': 0.36; 'pm,': 0.38; 'either': 0.39; '2015': 0.84; 'subject:find': 0.84; 'subject:Best': 0.91; 'to:none': 0.92; 'from.': 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:cc :content-type; bh=5dlU5yRaInvsRpMLFuLrAZbJNecURfDbXy98wSMbICA=; b=SBkY4q+O0UYLv1Lq6lW+jQVLVxHIU1aS5NNMXHOwg1yKpxRdIup7u/6SVjyujAM7Md INm5aueoWCStcTpUd5RXwyHG6jM/Lhr5d06CTLf4Hb/atvaKjF2nkF94u2vLo4bNzdI4 yduKGeS0KWrD88Vb8bRU6cmC7L68cp79cF4ejHGif7BH7joKwOCct0E3mGQpi2X6w78r 8M4Bnq6tVXOfgQo4XwDzTHlEyUKoTT5MxZMX5s+3BtXTc5BmxmgoBUVm5scPH7N4d1jr cSoqyNUv3chlB8XBQIbnY1HuPQnwZMccW5kcK0a6h2BgjeJY2jJF85HdMoq/lXaSRbo5 jeIg== MIME-Version: 1.0 X-Received: by 10.107.16.32 with SMTP id y32mr42329742ioi.53.1428588508238; Thu, 09 Apr 2015 07:08:28 -0700 (PDT) In-Reply-To: <87twwp76aj.fsf@dpt-info.u-strasbg.fr> References: <2e3a3c01-20b3-4948-9b32-bd80ed46822b@googlegroups.com> <552460cc$0$13002$c3e8da3$5496439d@news.astraweb.com> <876196cm1e.fsf@elektro.pacujo.net> <87k2xlzknu.fsf@elektro.pacujo.net> <8738498qf7.fsf@dpt-info.u-strasbg.fr> <87fv89zd0m.fsf@elektro.pacujo.net> <87y4m1795n.fsf@dpt-info.u-strasbg.fr> <874mopzarw.fsf@elektro.pacujo.net> <87twwp76aj.fsf@dpt-info.u-strasbg.fr> Date: Fri, 10 Apr 2015 00:08:27 +1000 Subject: Re: Best search algorithm to find condition within a range 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.20 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428588517 news.xs4all.nl 2921 [2001:888:2000:d::a6]:43986 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88719 On Thu, Apr 9, 2015 at 11:57 PM, Alain Ketterlin wrote: > Because, in: > > z = x+y; // all signed ints > if ( z < x ) > ... > > either there was no overflow (and the condition is false), or there was, > and the result is undefined, i.e., "z