FLINT3.7.0-dev

flint_mpn_mulhigh_normalised, flint_mpn_sqrhigh_normalised

Synopsis#include <flint/mpn_extras.h>
mp_limb_pair_t flint_mpn_mulhigh_normalised(mp_ptr rp, mp_srcptr xp, mp_srcptr yp, mp_size_t n)source
mp_limb_pair_t flint_mpn_sqrhigh_normalised(mp_ptr rp, mp_srcptr xp, mp_size_t n)source

flint_mpn_mulhigh_n and flint_mpn_sqrhigh followed by normalisation: if the top bit of the high product is clear, the (n+1)-limb result (high limbs and returned limb) is shifted left by one bit. Returns the low limb in m1 and the shift (0 or 1) in m2. For normalised inputs the product is at least B^{2n}/4, so the result is normalised. This is the form needed for floating-point mantissas (mp_real, arf). The output must not alias the inputs.

Cite this page

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