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

From Stefan Krah <stefan@bytereef.org>
Subject Re: python decimal library dmath.py v0.3 released
Date 2014-03-04 21:35 +0000
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>
Newsgroups comp.lang.python
Message-ID <mailman.7745.1393969211.18130.python-list@python.org> (permalink)

Show all headers | 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