Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36422

Re: Calculate Big Number

From Gisle Vanem <gvanem@broadpark.no>
References <mailman.244.1357605853.2939.python-list@python.org> <50ebb3c1$0$30003$c3e8da3$5496439d@news.astraweb.com>
Subject Re: Calculate Big Number
Date 2013-01-08 11:06 +0100
Newsgroups comp.lang.python
Message-ID <mailman.269.1357639597.2939.python-list@python.org> (permalink)

Show all headers | View raw


"Steven D'Aprano" <steve+comp.lang.python@pearwood.info> wrote:

> py> from timeit import Timer
> py> t1 = Timer("(a**b)*(c**d)", setup="a,b,c,d = 10, 25, 2, 50")
> py> min(t1.repeat(repeat=5, number=100000))
> 0.5256571769714355
> 
> So that's about 5 microseconds on my (slow) computer.

That's pretty fast. So is there still a need for a GMP python-binding like
gmpy? http://code.google.com/p/gmpy/wiki/IntroductionToGmpy

GMP can include optimized assembler for the CPU you're using. But
I guess it needs more memory. Hence disk-swapping could be an issue
on performance.

--gv

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Calculate Big Number Nac Temha <naccttemha@gmail.com> - 2013-01-08 02:44 +0200
  Re: Calculate Big Number Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-08 05:50 +0000
    Re: Calculate Big Number Gisle Vanem <gvanem@broadpark.no> - 2013-01-08 11:06 +0100
      Re: Calculate Big Number casevh@gmail.com - 2013-01-08 08:33 -0800
      Re: Calculate Big Number casevh@gmail.com - 2013-01-08 08:33 -0800

csiph-web