FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix arb powers with integer exponents by morluto · Pull Request #427 · flintlib/python-flint · GitHub

Repository navigation

Fix arb powers with integer exponents - #427

Open
morluto wants to merge 1 commit into
flintlib:mainfrom
morluto:fix-arb-integer-power
Open

morluto wants to merge 1 commit into
flintlib:mainfrom
morluto:fix-arb-integer-power

Conversation

morluto commented Sep 3, 2026

Copy link
Copy Markdown

Fixes #426.

arb.__pow__ currently converts Python and FLINT integer exponents to arb before dispatching to generic arb_pow. For an interval crossing zero, that path can return nan even for exponents such as 1 and 2.

This change preserves the exponent type and calls FLINT's integer-specific arb_pow_fmpz for Python int and fmpz operands. Other supported exponent types continue to use arb_pow as before. Regression coverage checks that zero-crossing interval powers remain finite and enclose representative values.

Validation:

  • spin test -- --pyargs flint.test.test_arb -q (47 passed)
  • spin test -- -q -k "not docstrings" (456 passed)
  • cython-lint src/

The full doctest collection was also attempted under a local CPython 3.14 free-threaded build; it has pre-existing doctest namespace failures unrelated to this change, so the passing general and focused suites above are the relevant evidence.

Copy link
Copy Markdown
Collaborator

Looks good. Thanks

Copy link
Copy Markdown
Collaborator

Can you add a release note in the README with your name?

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arb interval powers with integer exponents can return nan

2 participants


Back | FazBrowse Home | New Git URL