Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'python3': 0.07; '22,': 0.09; 'bits': 0.09; 'assume': 0.14; 'wrote': 0.14; 'angle': 0.16; 'bit.': 0.16; 'denotes': 0.16; 'escapes': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; 'meant': 0.20; '>>>': 0.22; 'looks': 0.24; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:wiki': 0.31; 'constant': 0.31; 'time:': 0.31; 'url:wikipedia': 0.31; 'problem': 0.35; 'no,': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'introduced': 0.61; 'term': 0.63; "'parity'": 0.84; '2014,': 0.84; 'otten': 0.84; 'parity': 0.84 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=NH3hfZjUKEOt3kMJtSfjuNKZM8mDtkQ9KuUxODKKeyU=; b=XLVGRA3MghBemTv+5CLexKH0OUzoAHZltieXi3MxYolQTHGG85gYKB+3+Bw7R6GQvx tZcLWqbsKGl3Fl7RLu96mO8jBPXSSExiYk+30yPyGWkLAnRCOmnbHBOX39spDh/0DX22 JGFhsIPA3jNqoXknPyo1Hs4w9Em0vU9GN9L87phwJ+GN27QPsYq6chwHr+GQdfIt3zdO lySg1eVIgD5TWWyjRJabqEIbCTnC1jOwZW+zcjWW9RfcLD+PbadNrhlgPo93h25BKPCo IaZRLxJu3ILkz5lDqH1eGdNVey+4+9u0WItVYGYSCN1ALCF9MTna179EnT62wlO/xht0 NThQ== X-Received: by 10.70.88.139 with SMTP id bg11mr3554108pdb.145.1413987871235; Wed, 22 Oct 2014 07:24:31 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <54476a77$0$21664$426a74cc@news.free.fr> <5447786d$0$12750$426a74cc@news.free.fr> <091815A9-38E8-4F34-AB03-F9402551DF9F@xs4all.nl> From: Ian Kelly Date: Wed, 22 Oct 2014 08:23:50 -0600 Subject: Re: (-1)**1000 To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 1413987880 news.xs4all.nl 2844 [2001:888:2000:d::a6]:37977 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79442 On Wed, Oct 22, 2014 at 5:02 AM, Peter Otten <__peter__@web.de> wrote: > Michiel Overtoom wrote: > >> >> On Oct 22, 2014, at 12:29, Peter Otten wrote: >> >>> That looks like log(a) while a parity check takes constant time: >>> $ python3 -m timeit -s 'a = 10**10' 'a & 1' >> >> >> Do you mean 'parity' as in http://en.wikipedia.org/wiki/Parity_bit ? >> Because a parity bit denotes whether the *number* of '1' bits is even or >> odd, not the value of the least significant bit. > > No, I meant the lsb. The OP introduced the term 'parity'; not sure if that > was erroneous, too, or if there is an angle to the problem that escapes me. Since the OP just wrote "parity", not "parity bit", I would assume they meant as in http://en.wikipedia.org/wiki/Parity_(mathematics)