Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3.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.051 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'base.': 0.05; 'assumed': 0.09; 'formatting': 0.09; 'integers': 0.09; 'vast': 0.09; 'python': 0.11; 'assume': 0.14; 'dump': 0.16; 'integer.': 0.16; 'integers,': 0.16; 'internally': 0.16; 'subject:search': 0.16; 'language': 0.16; 'wrote:': 0.18; 'addition,': 0.20; 'written': 0.21; 'programming': 0.22; 'preferred': 0.22; 'integer': 0.24; 'non': 0.24; "haven't": 0.24; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'character': 0.29; "doesn't": 0.30; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'too.': 0.31; 'default,': 0.31; 'division': 0.31; 'languages': 0.32; 'could': 0.34; 'display': 0.35; 'operations': 0.35; 'received:google.com': 0.35; "he's": 0.36; 'yield': 0.36; 'done': 0.36; 'similar': 0.36; 'two': 0.37; 'implement': 0.38; 'displays': 0.38; 'todo': 0.38; 'to:addr :python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'read': 0.60; 'dave': 0.60; 'problems.': 0.60; 'most': 0.60; 'tell': 0.60; "you're": 0.61; 'making': 0.63; 'email addr:gmail.com': 0.63; 'information': 0.63; 'presented': 0.69; '000,': 0.84; '2015': 0.84; 'subject:find': 0.84; 'yet?': 0.84; 'angel': 0.91; 'subject:Best': 0.91; '000': 0.93 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=thBjaXCig9/AmzNsqon6LefDuBIrJfKpZPA1EPScY7s=; b=BiDnwcrtS3ed4mvmHe14b3RmevNgiDNOHQjSyjVol04FtBfQFjgVD9WRLZ95JGWwQF Zrr1Nna2fChNTdWYf2BoQCMhKrg8SJ0KJIrnd8LmteFJqCaPNhe5pjLaN46rMCkeApsw 1s/s4xTLXD+7weMvEq4MeVl8vPyTUUugDkzq28fUYXI2N2xx4cCPGi2fOTAZYlT23b3q 8j4A9wfoIk7rnr63M6YTvqgPBhr8ZxBZJdHR6/lhpP1u8+5i6Bc7drB2Xt6LR0XivDNK +B/rHv43lvAGEdUsgKydNV/DpI3oZnJxCVImqLRq4VGjK1bXSS7eYSPIPuXy2iA/QQVE VMWA== X-Received: by 10.107.13.136 with SMTP id 130mr31301184ion.70.1428419224201; Tue, 07 Apr 2015 08:07:04 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <2e3a3c01-20b3-4948-9b32-bd80ed46822b@googlegroups.com> From: Ian Kelly Date: Tue, 7 Apr 2015 09:06:24 -0600 Subject: Re: Best search algorithm to find condition within a range To: Python 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428419232 news.xs4all.nl 2860 [2001:888:2000:d::a6]:60614 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88590 On Tue, Apr 7, 2015 at 8:36 AM, wrote: > Den tisdag 7 april 2015 kl. 16:30:15 UTC+2 skrev Denis McMahon: >> On Tue, 07 Apr 2015 09:29:59 -0400, Dave Angel wrote: >> >> > On 04/07/2015 05:44 AM, jonas.thornvall@gmail.com wrote: >> >> >> I want todo faster baseconversion for very big bases like base 1 000 >> >> 000, so instead of adding up digits i search it. >> >> > How do you know the baseconversion is the bottleneck, if you haven't >> > written any Python code yet? >> >> He doesn't. He doesn't comprehend that as far as a computer is concerned >> an integer has no specific 'base', it's only when presented in a form for >> humans to read that it gets base information added in the representation. >> >> He's making these and other similar errors in the javascript groups too. >> >> I suspect he's one of those people that spends his time thinking up >> elaborate solutions that he has no idea how to implement as a response to >> dreamt up non existent problems. >> >> -- >> Denis McMahon, denismfmcmahon@gmail.com > > 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. > > 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're conflating the internal representation of the integer with the formatting that is done to display the integer. When you do "print(x)", the computer doesn't just dump the internal representation of x onto the display. It formats x as character data and displays *that*. For integers, the vast majority of programming languages will do the formatting as base 10 by default, since that is the format preferred by most humans.