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


Groups > comp.lang.python > #36422

Re: Calculate Big Number

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <gvanem@broadpark.no>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.038
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'memory.': 0.05; 'assembler': 0.09; 'to:name:python-list': 0.15; 'subject:Big': 0.16; 'wrote:': 0.17; 'import': 0.21; 'x-mailer:microsoft outlook express 6.00.2900.5931': 0.22; 'url:wiki': 0.26; 'guess': 0.27; 'cpu': 0.29; 'fast.': 0.29; 'url:code': 0.29; 'computer.': 0.32; 'could': 0.32; 'subject:Number': 0.33; 'to:addr:python-list': 0.33; 'there': 0.35; 'but': 0.36; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'url:p': 0.63; 'skip:n 10': 0.63; 'more': 0.63
MIME-version 1.0
Content-transfer-encoding 7BIT
Content-type text/plain; CHARSET=US-ASCII; format=flowed; reply-type=original
From Gisle Vanem <gvanem@broadpark.no>
To Python-list <python-list@python.org>
References <mailman.244.1357605853.2939.python-list@python.org> <50ebb3c1$0$30003$c3e8da3$5496439d@news.astraweb.com>
Subject Re: Calculate Big Number
Date Tue, 08 Jan 2013 11:06:09 +0100
X-Priority 3
X-MSMail-priority Normal
X-Mailer Microsoft Outlook Express 6.00.2900.5931
X-MIMEOLE Produced By Microsoft MimeOLE V6.00.2900.6157
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.269.1357639597.2939.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357639597 news.xs4all.nl 6947 [2001:888:2000:d::a6]:42418
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36422

Show key headers only | 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