Re: Log base 2 of large integers

2014-08-13 Thread Ian Kelly
On Wed, Aug 13, 2014 at 10:18 AM, Chris Angelico wrote: > On Thu, Aug 14, 2014 at 2:12 AM, Peter Pearson > wrote: >> MK Shen used to hang out on the sci.crypt newsgroup, so we're >> probably talking "cryptographically large" rather than "engineeringly >> large". > > So "fairly large" means somew

Re: Log base 2 of large integers

2014-08-13 Thread Marko Rauhamaa
Peter Pearson : > MK Shen used to hang out on the sci.crypt newsgroup, so we're probably > talking "cryptographically large" rather than "engineeringly large". I'm thinking we're talking about philosophically large. Those kinds of numbers are unwieldy from all angles, including cryptography. Ma

Re: Log base 2 of large integers

2014-08-13 Thread Chris Angelico
On Thu, Aug 14, 2014 at 2:12 AM, Peter Pearson wrote: > MK Shen used to hang out on the sci.crypt newsgroup, so we're > probably talking "cryptographically large" rather than "engineeringly > large". So "fairly large" means somewhere between googolplex an Graham's Number, and after that they'd be

Re: Log base 2 of large integers

2014-08-13 Thread Peter Pearson
On Wed, 13 Aug 2014 15:58:02 +0200, Peter Otten <__pete...@web.de> wrote: > Mok-Kong Shen 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. [snip] > Or maybe our idea of "fairly large

Re: Log base 2 of large integers

2014-08-13 Thread Peter Otten
Steven D'Aprano wrote: > Mok-Kong Shen 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? > > If you want the integer log2, that

Re: Log base 2 of large integers

2014-08-13 Thread Andrew Jaffe
On 13/08/2014 14:46, Mok-Kong Shen wrote: Am 13.08.2014 15:32, schrieb Steven D'Aprano: Mok-Kong Shen 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 th

Re: Log base 2 of large integers

2014-08-13 Thread Peter Otten
Mok-Kong Shen 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? What version of Python are you using? Python 2.7 can handle "fairly large"

Re: Log base 2 of large integers

2014-08-13 Thread Mok-Kong Shen
Am 13.08.2014 15:16, schrieb Skip Montanaro: http://gnumbers.blogspot.com/2011/10/logarithm-of-large-number-it-is-not.html Might be worth studying for ideas. Thanks. I think the idea may help. M. K. Shen -- https://mail.python.org/mailman/listinfo/python-list

Re: Log base 2 of large integers

2014-08-13 Thread Mok-Kong Shen
Am 13.08.2014 15:32, schrieb Steven D'Aprano: Mok-Kong Shen 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? If you want the integer log2, that is

Re: Log base 2 of large integers

2014-08-13 Thread Steven D'Aprano
Mok-Kong Shen 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? If you want the integer log2, that is, the floor of log2, the simplest wa

Re: Log base 2 of large integers

2014-08-13 Thread Skip Montanaro
On Wed, Aug 13, 2014 at 8:05 AM, Mok-Kong Shen 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:

Log base 2 of large integers

2014-08-13 Thread Mok-Kong Shen
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? Thanks in advance. M. K. Shen -- https://mail.python.org/mailman/listinfo/python-list