Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'languages,': 0.04; 'output': 0.05; 'binary': 0.07; 'default;': 0.09; 'integers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'assume': 0.14; 'merely': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:search': 0.16; 'language': 0.16; 'programming': 0.22; 'integer': 0.24; 'specify': 0.24; 'url:home': 0.24; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'assumes': 0.31; 'decimal': 0.31; 'probably': 0.32; 'languages': 0.32; 'done.': 0.35; 'operations': 0.35; 'there': 0.35; 'yield': 0.36; 'done': 0.36; 'charset:us-ascii': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'conversion': 0.61; 'email addr:gmail.com': 0.63; 'such': 0.63; 'answer.': 0.68; 'default': 0.69; '2015': 0.84; 'subject:find': 0.84; 'subject:Best': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Best search algorithm to find condition within a range Date: Tue, 07 Apr 2015 20:06:50 -0400 Organization: IISS Elusive Unicorn References: <2e3a3c01-20b3-4948-9b32-bd80ed46822b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-68-178-130.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428451620 news.xs4all.nl 2855 [2001:888:2000:d::a6]:40363 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88634 On Tue, 7 Apr 2015 08:47:38 -0700 (PDT), jonas.thornvall@gmail.com declaimed the following: >No i don't i say the operations assume base ten other wise INT A=7,B=4 Calculate C=A+B would not yield 11 as an answer. The programming languages assume integer operations are done in base 10, at least the one where you can not specify in what base the integer arithmetic is done. And there probably is such languages, Python maybe? Unless you are using COBOL, where the default for integers is BCD, the "integer operations" are done in binary... The language compiler/interpreter merely assumes that /literals/ found in the /source/ are decimal by default; and output conversion is from binary to decimal representation. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/