lina wrote:
> On Sat, Dec 10, 2011 at 6:09 PM, Peter Otten <__pete...@web.de> wrote:
>> surya k wrote:
>>
>>> Finding factorial of 8 or 9 isn't big. If I would like to find factorial
>>> of 32327, how can I ?
>>
>> gmpy is a library designed for working with large numbers. Compare:
>>
> import
On Sat, Dec 10, 2011 at 6:09 PM, Peter Otten <__pete...@web.de> wrote:
> surya k wrote:
>
>> Finding factorial of 8 or 9 isn't big. If I would like to find factorial
>> of 32327, how can I ?
>
> gmpy is a library designed for working with large numbers. Compare:
>
import time
def bench(f,
surya k wrote:
> Finding factorial of 8 or 9 isn't big. If I would like to find factorial
> of 32327, how can I ?
gmpy is a library designed for working with large numbers. Compare:
>>> import time
>>> def bench(f, *args):
... start = time.time()
... try:
... return f(*args)
surya k wrote:
Finding factorial of 8 or 9 isn't big. If I would like to find factorial of 32327, how can I ??
py> import math
py> n = math.factorial(32327) # takes about 2 seconds on my computer
py> s = str(n) # takes about 30 seconds
py> len(s)
131744
py> print s[:10] + "..."
> There are other approaches that may bear looking at, like the SciPy library.
> But first we'd need to know just what you need with this factorial.
Wouldn't a prime swing implementation be the absolutely fastest?
Something like this:
http://en.literateprograms.org/Special:Downloadcode/Factorials
On 12/09/2011 03:04 PM, surya k wrote:
Date: Fri, 9 Dec 2011 14:53:07 -0500
From: d...@davea.name
To: sur...@live.com
CC: tutor@python.org
Subject: Re: [Tutor] how to handle big numbers
On 12/09/2011 02:25 PM, surya k wrote:
Finding factorial of 8
> Date: Fri, 9 Dec 2011 14:53:07 -0500
> From: d...@davea.name
> To: sur...@live.com
> CC: tutor@python.org
> Subject: Re: [Tutor] how to handle big numbers
>
> On 12/09/2011 02:25 PM, surya k wrote:
> > Finding factorial of 8
On 12/09/2011 02:25 PM, surya k wrote:
Finding factorial of 8 or 9 isn't big. If I would like to find factorial of
32327, how can I ??
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscriptio
On 09/12/11 19:25, surya k wrote:
Finding factorial of 8 or 9 isn't big. If I would like to find factorial of
32327, how can I ??
Just type it in, but expect to wait a long time for the answer...
Python integers are limited by the memory of your machi
Finding factorial of 8 or 9 isn't big. If I would like to find factorial of
32327, how can I ??
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mail
10 matches
Mail list logo