FLINT3.7.0-dev

mp_real_exp_is_safe, mp_real_is_safe

Synopsis#include <flint/mp_real.h>
int mp_real_exp_is_safe(slong e)source
int mp_real_is_safe(const mp_real_t x)source

Return whether |e| \le MP_REAL_EXP_MAX, respectively whether the exponent of x is safe.

An operation whose ball operands are safe, and whose bit-exponent arguments e (of mp_real_mul_2exp_si, mp_real_add_error_2exp_si, mp_real_add_rel_error_2exp_si and _mp_real_set_mpn_2exp) satisfy |e| \le FLINT_BITS * MP_REAL_EXP_MAX, computes without overflow. Its result may lie outside the safe range, so a chain of operations whose exponents can grow must check again.

Guides#

Cite this page

The FLINT team, “mp_real_exp_is_safe, mp_real_is_safe (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/mp_real_exp_is_safe.html (generated 2026-10-20).