library for arbitrary-precision floating-point arithmetic
Mpmath is a pure-Python library for multiprecision floating-point arithmetic. It provides an extensive set of transcendental functions, unlimited exponent sizes, complex numbers, interval arithmetic, numerical integration and differentiation, root-finding, linear algebra, and much more. Almost any calculation can be performed just as well at 10-digit or 1000-digit precision, and in many cases pmath implements asymptotically fast algorithms that scale well for extremely high precision work.
If available, mpmath will (optionally) use gmpy to speed up high precision operations. If matplotlib is available, mpmath also provides a convenient plotting interface.
Its features include:
- Fair performance -- typically 10-100x faster than Python's decimal library
- Transcendental functions -- all functions from Python's math and cmath modules, plus a few more like gamma, factorial, erf
- Complex numbers -- with support for transcendental functions
- Directed rounding -- floor, ceiling, down, up, half-down, half-up, half-even
- Unlimited exponents -- no overflow or underflow
25 February 2016
Leaders and contributors
|Fredrik Johansson||Maintainer 2005-2013|
Resources and communication
|Developer||VCS Repository Webview||http://github.com/fredrik-johansson/mpmath|
|Required to use||Python 2.5 or higher|
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the page “GNU Free Documentation License”.
The copyright and license notices on this page only apply to the text on this page. Any software or copyright-licenses or other similar notices described in this text has its own copyright notice and license, which can usually be found in the distribution or license text itself.