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


Groups > comp.lang.python > #67726

Re: python decimal library dmath.py v0.3 released

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'see:': 0.07; 'subject:released': 0.07; 'function,': 0.09; 'function:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'message-id:@post.gmane.org': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:library': 0.16; 'subject:python': 0.16; 'stefan': 0.19; 'header:User-Agent:1': 0.23; 'example.': 0.24; 'header:X-Complaints-To:1': 0.27; 'especially': 0.30; 'decimal': 0.31; 'writes:': 0.31; 'probably': 0.32; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'to:addr:python- list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'number,': 0.60; 'numbers': 0.61
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Stefan Krah <stefan@bytereef.org>
Subject Re: python decimal library dmath.py v0.3 released
Date Tue, 4 Mar 2014 21:35:48 +0000 (UTC)
References <55fc232e-f1a5-4c28-8fc0-06b3e3c63a68@googlegroups.com> <44cb976d-cb25-468a-8525-edbf4b539f60@googlegroups.com> <1ba60da3-93d4-4bca-ab96-9f94e6afe519@googlegroups.com> <27d19767-84ee-4ab7-87fd-784e8ac57680@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host sea.gmane.org
User-Agent Loom/3.14 (http://gmane.org/)
X-Loom-IP 85.179.175.115 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0)
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.7745.1393969211.18130.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1393969211 news.xs4all.nl 2914 [2001:888:2000:d::a6]:37905
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67726

Show key headers only | View raw


[I found this via the python-ideas thread]

Wolfgang Maier <wolfgang.maier <at> biologie.uni-freiburg.de> writes:
> math.factorial is accurate and faster than your pure-Python function,
especially for large numbers.

It is slower for huge numbers than decimal if you use this
Python function:

http://www.bytereef.org/mpdecimal/quickstart.html#factorial-in-pure-python


Be sure to set MAX_EMAX and MIN_EMIN, that's missing in the example.


If you want to *see* all digits of a very large number, then decimal is
probably even faster than gmpy. See:

http://www.bytereef.org/mpdecimal/benchmarks.html#arbitrary-precision-libraries



Stefan Krah

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


Thread

python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 03:34 -0800
  Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 04:02 -0800
  Re: python decimal library dmath.py v0.3 released Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-03-03 13:34 +0000
    Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 06:27 -0800
    Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 07:22 -0800
      Re: python decimal library dmath.py v0.3 released Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-03-03 16:44 +0000
        Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 08:52 -0800
  Re: python decimal library dmath.py v0.3 released Wolfgang Maier <xpysol@gmail.com> - 2014-03-03 09:23 -0800
    Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 12:03 -0800
      Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 13:18 -0800
        Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 14:08 -0800
        Re: python decimal library dmath.py v0.3 released Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-03-03 14:44 -0800
          Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 17:42 -0800
      Re: python decimal library dmath.py v0.3 released Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-03-03 14:15 -0800
        Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 14:42 -0800
        Re: python decimal library dmath.py v0.3 released Stefan Krah <stefan@bytereef.org> - 2014-03-04 21:35 +0000
          Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-04 18:28 -0800
  Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-03 17:46 -0800
    Re: python decimal library dmath.py v0.3 released "Mark H. Harris" <harrismh777@gmail.com> - 2014-03-04 23:09 -0800

csiph-web