nfloat_set_mpn_2exp, _nfloat_set_mpn_2exp
Synopsis
#include <flint/nfloat.h>int nfloat_set_mpn_2exp(nfloat_ptr res, nn_srcptr x, slong xn, slong exp, int xsgnbit, gr_ctx_t ctx)sourceint _nfloat_set_mpn_2exp(nfloat_ptr res, nn_srcptr x, slong xn, slong exp, int xsgnbit, gr_ctx_t ctx)sourceSet res to (-1)^{\mathit{xsgnbit}} \cdot f \cdot 2^{\mathit{exp}}, where f = \{x, \mathit{xn}\} / 2^{\mathit{xn} \cdot \mathtt{FLINT\_BITS}} is the fraction in [0, 1) given by the xn words of x, rounded to the precision of the context. The version with an underscore requires that the top word x[xn - 1] is nonzero; the other removes leading zero words and handles f = 0.
Cite this page
The FLINT team, “nfloat_set_mpn_2exp, _nfloat_set_mpn_2exp (nfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nfloat/nfloat_set_mpn_2exp.html (generated 2026-10-20).
@misc{flint-doc-nfloat-nfloat-set-mpn-2exp,
author = {{The FLINT team}},
title = {{nfloat\_set\_mpn\_2exp, \_nfloat\_set\_mpn\_2exp (nfloat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nfloat/nfloat_set_mpn_2exp.html},
note = {Generated 2026-10-20}
}