FLINT3.7.0-dev

mp_real_set_trunc

Synopsis#include <flint/mp_real.h>
void mp_real_set_trunc(mp_real_t res, const mp_real_t x, slong n)source

Set res to x rounded to its top n \ge 1 limbs (a copy if x has at most n limbs). res may alias x.

The dropped tail and the old radius are each below one ulp of the new last limb, so the new radius is [\mathrm{tail} \ne 0] + [\mathrm{radius} \ne 0] ulps. The result is exact if nothing nonzero is dropped from an exact input.

Cite this page

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