FLINT3.7.0-dev

_arf_mpn_set_round

Synopsis#include <flint/arf.h>
int _arf_mpn_set_round(nn_ptr res, slong * exp, nn_srcptr x, slong xn, slong prec, arf_rnd_t rnd)source

Rounds the exact value (x/Bxn)2E(x / B^{\mathit{xn}}) 2^E, where x has a nonzero top limb (leading zero bits allowed), to prec bits in the sign-free mode rnd, writing the rn\mathit{rn} normalised limbs res with the bits below prec zero: the result is (res/Brn)2E+exp(\mathit{res} / B^{\mathit{rn}}) 2^{E + \mathit{exp}}. Returns the inexact flag. res may be x or lie below it in the same buffer (in-place rounding; then xn≥rn\mathit{xn} \ge \mathit{rn}).

Cite this page

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