Arbitrary-precision multiple-precision floats in Python: mpmath, gmpy, sympy .evalf() / N()
> Python library for arbitrary-precision floating-point arithmetic
> General Multi-Precision arithmetic for Python 2.6+/3+ (GMP, MPIR, MPFR, MPC)
- Integers, Rationals, Reals, Complex
> Exact SymPy expressions can be converted to floating-point approximations (decimal numbers) using either the .evalf() method or the N() function.
> [...]
> By default, numerical evaluation is performed to an accuracy of 15 decimal digits. You can optionally pass a desired accuracy (which should be a positive integer) as an argument to evalf or N:
>>> N(sqrt(2)*pi, 5)
4.4429
>>> N(sqrt(2)*pi, 50)
4.4428829381583662470158809900606936986146216893757