Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2a.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.05; 'integers': 0.09; 'polish': 0.09; 'cc:addr:python-list': 0.11; '(within': 0.16; '>in': 0.16; '>on': 0.16; 'bases,': 0.16; 'eternal': 0.16; 'expect,': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'golden': 0.16; 'message- id:@cskk.homeip.net': 0.16; 'reason).': 0.16; 'simpson': 0.16; 'subject:search': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'language': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'input': 0.22; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'header :User-Agent:1': 0.23; 'integer': 0.24; 'cheers,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'law.': 0.26; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; "d'aprano": 0.31; 'douglas': 0.31; 'steven': 0.31; 'proceed': 0.33; 'yield': 0.36; 'charset:us- ascii': 0.36; 'two': 0.37; 'does': 0.39; 'even': 0.60; 'tell': 0.60; 'content-disposition:inline': 0.62; 'email addr:gmail.com': 0.63; 'account': 0.65; 'reverse': 0.68; '2015': 0.84; 'received:192.168.15': 0.84; 'subject:find': 0.84; 'subject:Best': 0.91 Date: Wed, 8 Apr 2015 08:51:24 +1000 From: Cameron Simpson To: Steven D'Aprano Cc: python-list@python.org Subject: Re: Best search algorithm to find condition within a range MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <55245c0b$0$13010$c3e8da3$5496439d@news.astraweb.com> User-Agent: Mutt/1.5.23 (2014-03-12) References: <55245c0b$0$13010$c3e8da3$5496439d@news.astraweb.com> 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428447094 news.xs4all.nl 2916 [2001:888:2000:d::a6]:33187 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3736 X-Received-Body-CRC: 2706481678 Xref: csiph.com comp.lang.python:88624 On 08Apr2015 08:36, Steven D'Aprano wrote: >On Wed, 8 Apr 2015 12:36 am, jonas.thornvall@gmail.com wrote: >> Bullshit declare two integers in any language one 7 and one 4 and then >> write x=7+4; if you find a programming language where that does not yield >> 11 tell me. > >In Forth, you can set the base to any arbitrary integer (within reason). [...snip...] In dc also (UNIX's reverse polish arbitrary precision "decimal calculator"). You can set the input and output representation bases, and proceed without leading base indicators. Cheers, Cameron Simpson Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. - Douglas Hosfstadter, Godel, Escher, Bach: an Eternal Golden Braid