Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1a.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; 'base.': 0.05; 'shipped': 0.05; 'debug': 0.07; 'intel': 0.07; 'plenty': 0.07; 'wang': 0.07; 'assumed': 0.09; 'exist,': 0.09; 'integers': 0.09; 'assume': 0.14; 'wrote': 0.14; "(it's": 0.16; 'assembler': 0.16; 'hex': 0.16; 'internally': 0.16; 'literals*': 0.16; 'literals,': 0.16; 'literals.': 0.16; 'pcs,': 0.16; 'processors': 0.16; 'subject:search': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'addition,': 0.20; 'machine': 0.22; '>>>': 0.22; 'code,': 0.22; 'memory': 0.22; 'example': 0.22; 'programming': 0.22; 'saying': 0.22; 'header :User-Agent:1': 0.23; 'bytes': 0.24; 'certainly': 0.24; 'integer': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; 'matching': 0.30; "i'm": 0.30; 'work.': 0.31; 'usually': 0.31; 'correctly.': 0.31; 'division': 0.31; 'probably': 0.32; 'languages': 0.32; 'quite': 0.32; 'skip:d 20': 0.34; "i'd": 0.34; 'could': 0.34; "can't": 0.35; 'form.': 0.35; 'operations': 0.35; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'curious': 0.36; 'ibm': 0.36; 'in.': 0.36; "didn't": 0.36; 'needed': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'course.': 0.60; 'today,': 0.61; "you're": 0.61; 'our': 0.64; 'charset:windows-1252': 0.65; 'received:74.208': 0.68; 'default': 0.69; 'computers': 0.72; 'day': 0.76; '2015': 0.84; 'actually,': 0.84; 'dozens': 0.84; 'received:74.208.4.194': 0.84; 'subject:find': 0.84; 'edwards': 0.91; 'subject:Best': 0.91; 'hundred': 0.95 Date: Tue, 07 Apr 2015 11:23:54 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Best search algorithm to find condition within a range References: <2e3a3c01-20b3-4948-9b32-bd80ed46822b@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Z7JH9Tcl+sHQYl5JQsdDnkHTod9J5oK8uT2KcKTQh3Dt5I0oMMy yzWRyUb4Rf2WLgOx8AL7XMu6ve1goNvLIHiH9lcUo5Vtdbc8HJ56+4nM5gK5TwDbfkk5+xx /nZ5YNkg56RCS86Z1N+iiJr4S/l5lH4Ccm5DTAxooStmLbSa2AhzcMCuP1lglibVv6dVdJK SDyYbHQym94ERRYofbf3g== X-UI-Out-Filterresults: notjunk:1; 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428420247 news.xs4all.nl 2828 [2001:888:2000:d::a6]:42240 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88592 On 04/07/2015 11:05 AM, Grant Edwards wrote: > On 2015-04-07, Chris Angelico wrote: >> On Wed, Apr 8, 2015 at 12:36 AM, wrote: >> >>> Integers are internally assumed to be base 10 otherwise you could not >>> calculate without giving the base. >>> >>> All operations on integers addition, subtraction, multiplication and >>> division assume base 10. >> >> You misunderstand how computers and programming languages work. What >> you're seeing there is that *integer literals* are usually in base >> 10; and actually, I can point to plenty of assembly languages where >> the default isn't base 10 (it's usually base 16 (hexadecimal) on IBM >> PCs, and probably base 8 (octal) on big iron). > > I'd be curious to see some of those assemblers. I've used dozens of > assemblers over the years for everything from microprocessors with a > few hundred bytes of memory to mini-computers and mainframes. I've > never seen one that didn't default to base 10 for integer literals. > > I'm not saying they don't exist, just that it would be interesting to > see an example of one. > I can't "show" it to you, but the assembler used to write microcode on the Wang labs 200VP and 2200MVP used hex for all its literals. I wrote the assembler (and matching debugger-assembler), and if we had needed other bases I would have taken an extra day to add them in. That assembler was not available to our customers, as the machine shipped with the microcode in readonly form. Not quite as readonly as the Intel processors of today, of course. Additionally, the MSDOS DEBUG program used hex to enter in its literals, if i recall correctly. Certainly when it disassembled code, it was in hex. -- DaveA