unstale

pypi / gmpy2

gmpy2

What changed in gmpy2 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.

4 breaking9 new APIs and options2 performance2 behavior and defaults13 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

gmpy2 230 changes

Breaking changes 4

New APIs and options 9

  • Adds alternate-form support in floating-point formatting.

    2.3.0release notes

  • Division functions now receive context arguments.

    2.3.0release notes

  • Adds mixed-mode arithmetic support for mpc.

    2.3.0release notes

  • Adds support for '%' formatting of mpfr values.

    2.3.0release notes

  • Adds an is_integer() method for mpq values.

    2.3.0release notes

  • Adds limit_denominator() to mpq.

    2.3.0release notes

  • Adds support for floating-point formatting types for mpz values.

    2.3.0release notes

  • Adds an mpz.__array__() method to interact with NumPy.

    2.3.0release notes

  • Adds an is_integer() method for mpz values.

    2.3.0release notes

Performance 2

Behavior and default changes 2

Fixes and other changes 13

  • An IEEE-related fix was merged.

    2.3.1release notes

  • Converting an infinite mpfr value to float is supported instead of raising OverflowError.

    2.3.0release notes

  • Fixes a memory leak when exiting a context.

    2.3.0release notes

  • Fixes mixed-mode complex division when the left operand is real.

    2.3.0release notes

  • Fixes creating mpfr values from negative values with base=0.

    2.3.0release notes

  • Fixes conversion of mpq values to float.

    2.3.0release notes

  • Fixes conversion of mpz values to float.

    2.3.0release notes

  • Corrects the optimization used when rounding mpz values with negative ndigits.

    2.3.0release notes

  • Avoids OverflowError in mpz right-shift operations.

    2.3.0release notes

  • String output ignores the sign bit of NaNs, matching CPython.

    2.3.0release notes

  • Adds support for PyPy.

    2.3.0release notes

  • Rounding methods use the context's rounding mode.

    2.3.0release notes

  • Adds missing exceptions for true division.

    2.3.0release notes