Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76194
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <skip.montanaro@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.025 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; 'that?': 0.05; 'cc:addr :python-list': 0.11; 'compute': 0.16; 'feasible': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'googling': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'integer': 0.24; 'skip': 0.24; 'fairly': 0.24; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '13,': 0.31; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'too': 0.37; 'url:blogspot': 0.65; 'worth': 0.66; 'url:2011': 0.75; 'ideas.': 0.84; 'studying': 0.84; 'subject:base': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+BVLCbQnnyVVdelks3isD4UwGG1fj1xt2DGjaBeWSLI=; b=VQMAtay4bUREmvZ6V0W3vLGzwSCWY5LA98CpEcIpFv9+bmD2DIc+259eJzIbEXnyZB 40NNx0L1E3/OmLu5Pbj3JJIMMI5VjKmqmjMhj+GY8hCGBQemDi6RMvHzFXln+kOOaWIc fH9p3Aa5licVgd/UM2OcFdtVBboXdEqf45UuEfl+B4+jsf1Zhv3qA2453Mqp49mNVotC SpT10XhhY+kysAIvc2/QuMQbdtvcTmQqbKe7jBdtHzU7BntB4MIlUbHxxbZIzwPFRKiz MlNJ3IPrh0LWf65SfFVlxHeraOTYRe8MTsBGi6lL9lh4CnSeoJ6fcyD0OyJzESEZmCAR WCzw== |
| MIME-Version | 1.0 |
| X-Received | by 10.42.82.6 with SMTP id b6mr6210625icl.51.1407935800559; Wed, 13 Aug 2014 06:16:40 -0700 (PDT) |
| Sender | skip.montanaro@gmail.com |
| In-Reply-To | <lsfnr6$pbc$1@news.albasani.net> |
| References | <lsfnr6$pbc$1@news.albasani.net> |
| Date | Wed, 13 Aug 2014 08:16:40 -0500 |
| X-Google-Sender-Auth | Vt12wsYATeMQV0CfgjUAI6k9MaM |
| Subject | Re: Log base 2 of large integers |
| From | Skip Montanaro <skip@pobox.com> |
| To | Mok-Kong Shen <mok-kong.shen@t-online.de> |
| Content-Type | text/plain; charset=UTF-8 |
| Cc | Python <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.12921.1407935803.18130.python-list@python.org> (permalink) |
| Lines | 16 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1407935803 news.xs4all.nl 2900 [2001:888:2000:d::a6]:47666 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:76194 |
Show key headers only | View raw
On Wed, Aug 13, 2014 at 8:05 AM, Mok-Kong Shen <mok-kong.shen@t-online.de> wrote: > I like to compute log base 2 of a fairly large integer n but > with math.log(n,2) I got: > > OverflowError: long int too large to convert to float. > > Is there any feasible work-around for that? A bit of googling turned up this page: http://gnumbers.blogspot.com/2011/10/logarithm-of-large-number-it-is-not.html Might be worth studying for ideas. Skip
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Log base 2 of large integers Mok-Kong Shen <mok-kong.shen@t-online.de> - 2014-08-13 15:05 +0200
Re: Log base 2 of large integers Skip Montanaro <skip@pobox.com> - 2014-08-13 08:16 -0500
Re: Log base 2 of large integers Mok-Kong Shen <mok-kong.shen@t-online.de> - 2014-08-13 15:50 +0200
Re: Log base 2 of large integers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-13 23:32 +1000
Re: Log base 2 of large integers Mok-Kong Shen <mok-kong.shen@t-online.de> - 2014-08-13 15:46 +0200
Re: Log base 2 of large integers Marko Rauhamaa <marko@pacujo.net> - 2014-08-13 17:00 +0300
Re: Log base 2 of large integers Andrew Jaffe <a.h.jaffe@gmail.com> - 2014-08-13 15:06 +0100
Re: Log base 2 of large integers Peter Otten <__peter__@web.de> - 2014-08-13 16:17 +0200
Re: Log base 2 of large integers Peter Otten <__peter__@web.de> - 2014-08-13 15:58 +0200
Re: Log base 2 of large integers Peter Pearson <ppearson@nowhere.invalid> - 2014-08-13 16:12 +0000
Re: Log base 2 of large integers Marko Rauhamaa <marko@pacujo.net> - 2014-08-13 19:15 +0300
Re: Log base 2 of large integers Chris Angelico <rosuav@gmail.com> - 2014-08-14 02:18 +1000
Re: Log base 2 of large integers Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-13 12:13 -0600
Re:Log base 2 of large integers Dave Angel <davea@davea.name> - 2014-08-13 10:10 -0400
csiph-web