mpmath

1.4.1 · active · verified Sat Mar 28

mpmath is a Python library for arbitrary-precision floating-point arithmetic, currently at version 1.4.1, with a release cadence of approximately every 1-2 years.

Warnings

Install

Imports

Quickstart

This example computes 50 digits of pi by numerically evaluating the Gaussian integral using mpmath.

from mpmath import mp
mp.dps = 50
print(mp.quad(lambda x: mp.exp(-x**2), [-mp.inf, mp.inf]) ** 2)

view raw JSON →