You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
arb interval powers with integer exponents can return nan #426
Raising an arb interval that crosses zero to an exact integer exponent can return nan, even when the power has a finite real enclosure. This affects the released 0.9.0 wheel and the current arb.__pow__ implementation.
Reproducer
fromflintimportarbx=arb(0, 1)
print(x) # [+/- 1.01]print(x**1) # nanprint(x**2) # nan
Observed with python-flint 0.9.0 and FLINT 3.6.0.
Expected behavior
Both results should be finite enclosures. In particular, squaring an interval that contains [-1, 1] should contain both 0 and 1.
Cause
arb.__pow__ currently converts every supported exponent to an arb and calls arb_pow. That discards the fact that Python int and fmpz operands are exact integers. FLINT exposes arb_pow_fmpz specifically for integer exponents, and using it also avoids the zero-crossing failure in generic real exponentiation.
Activity