mpmath 1.4.0 released

47 views
Skip to first unread message

Oscar Benjamin

unread,
Feb 23, 2026, 5:32:41 AM (5 days ago) Feb 23
to sympy
Hi all,

(Sending on behalf of Sergey)

mpmath 1.4.0 is available on GitHub (https://github.com/mpmath/mpmath) and
PyPi (https://pypi.org/project/mpmath/).

Thanks to everyone who contributed to this release! Brief summary of most
important changes follows.

Features:

* Support "python -m mpmath" to provide CLI for interactive work (Sergey B
Kirpichev)
* Support formatting of mp.mpf and mp.mpc in f-strings or with format()
builtin like for floats and complxes (Javier Garcia, Sergey B Kirpichev)
* Support 'a'/'A' (hexadecimal) and 'b' (binary) formatting types (Sergey B
Kirpichev)
* Support rounding modes (MPFR-like) for formatting (Javier Garcia, Sergey B
Kirpichev)
* round(mp.mpf) now returns a mp.mpf instance (Sergey B Kirpichev)
* Better introspection support for decorated functions (Sergey B Kirpichev)
* Add mp.pretty_dps property to control number of printed digits (Sergey B
Kirpichev)
* Support negative indexes in matrix (Riccardo Orsi)
* Add parameters for MPContext constructor (Sergey B Kirpichev)
* Add pretty_dps context property to control number of printed digits (Sergey
B Kirpichev)
* Support rounding property for the mp context (Sergey B Kirpichev)
* Add Fox H-function (with rational parameters) (Hongren Zheng)
* Experimental support for free-threading builds (Sergey B Kirpichev)

Compatibility:

* Drop Python 2 support (Fangchen Li)
* Drop support for Python versions < 3.9 (Sergey B Kirpichev)
* Direct access to _mpf_ tuples now deprecated (Sergey B Kirpichev)
* Removed sage backend (Sergey B Kirpichev)
* Deprecate current (descending) order of coefficients in polynomial functions
(Sergey B Kirpichev, Warren Weckesser)
* Importing from the mpmath.libmp's submodules is deprecated (Sergey B
Kirpichev)

Bug fixes:

* Warn users about Python's true division (Sergey B Kirpichev)
* Correct pow() for mpf's to be consistent with mpfr/float's (Sergey B
Kirpichev)
* Fix mpc() constructor to be compatible with complex(), fix disagreement
fp.pow vs mp.pow (Sergey B Kirpichev)
* Pevent erroneous setting of dps/prec on mpmath module (Colin B. Macdonald)
* Correct atan2(±inf, ±inf) (Sergey B Kirpichev)
* Improve accuracy of log1p() (Tim Peters, Sergey B Kirpichev)
* Fix mpf_div() for prec=0 (Sergey B Kirpichev)
* Use correct mixed-mode functions in fsub/fdiv, add special cases for
infinities in mpc_*div() (Sergey B Kirpichev)
* Add special case for ±inf in polylog_continuation() (Sergey B Kirpichev,
Colin B. Macdonald)
* Increase working precision in polylog_general() for negative s (Sergey B
Kirpichev)
* Correct case for integer n in besselj/besseli (Sergey B Kirpichev)
* Fix erf(z) with re(z) of large magnitude (Sergey B Kirpichev)

Maintenance:

* Run CI tests with pytest-xdist (Sergey B Kirpichev)
* Add pyproject.toml, depend on flake518 (Sergey B Kirpichev)
* Port torture.py/extratest_zeta.py/extratest_gamma.py to the pytest framework
(Sergey B Kirpichev)
* Use math.isqrt in isqrt_python calculations (Daiki Takahashi)
* Use gcd() and other bigint's functions from the backend (Sergey B Kirpichev)
* Avoid dynamic method creation in _mpf (Sergey B Kirpichev)
* Use setuptools_scm to update __version__ (Sergey B Kirpichev)
* Add CONTRIBUTING.rst (Sergey B Kirpichev)
* Refactor Github Actions (Sergey B Kirpichev)
* Add backport action (Sergey B Kirpichev)

See the CHANGES (https://github.com/mpmath/mpmath/blob/master/CHANGES) for a
more complete changelog.

See the release milestone (https://github.com/mpmath/mpmath/milestone/1) for a
complete list of issues and pull requests involved in this release.

Let me know if there are any issues that need to be patched urgently.

--
Oscar

Gábor Horváth

unread,
Feb 23, 2026, 6:19:31 PM (4 days ago) Feb 23
to sympy

Hi All!

Thanks for this.

I upgraded with pip from 1.3.0 to 1.4.0, and then a "pip check" reported

"sympy 1.14.0 has requirement mpmath<1.4,>=1.1.0, but you have mpmath
1.4.0."

Does mpmath 1.4 really break sympy 1.14? If so, in what respect?

Thanks,
Gábor
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sympy/CAHVvXxQr1JTb2yMcUhd57v0Mk3EFDfNC%3D2kSneLQq4w_n4kzrQ%40mail.gmail.com.
>

Oscar Benjamin

unread,
Feb 23, 2026, 6:32:51 PM (4 days ago) Feb 23
to sy...@googlegroups.com
On Mon, 23 Feb 2026 at 23:19, Gábor Horváth <hungabo...@gmail.com> wrote:
>
>
> Hi All!
>
> Thanks for this.
>
> I upgraded with pip from 1.3.0 to 1.4.0, and then a "pip check" reported
>
> "sympy 1.14.0 has requirement mpmath<1.4,>=1.1.0, but you have mpmath
> 1.4.0."
>
> Does mpmath 1.4 really break sympy 1.14? If so, in what respect?

I don't think it breaks anything in sympy but some sympy operations
that call mpmath functions will raise deprecation warnings (try
sympy.test(parallel=True) to see them). The upper cap version
constraint ensures that anyone doing pip install sympy will not see
those warnings but if you manually intervene to get mpmath 1.4.0
alongside current versions of sympy (<=1.14) then you might see
warnings. I believe those warnings are all addressed in sympy master
already so we just need a new release with a new upper cap. The upper
cap in sympy makes it possible for mpmath to deprecate these things
without most sympy users ever seeing those warnings or any breakage.

--
Oscar
Reply all
Reply to author
Forward
0 new messages