decfloat_set_round, decfloat_set_round_si, decfloat_set_round_ui, decfloat_set_round_fmpz, decfloat_set_round_fmpq, decfloat_set_round_d, decfloat_set_round_str, decfloat_set_round_fmpz_10exp_fmpz, decfloat_set_round_fmpz_2exp_fmpz, decfloat_set_round_arf
Synopsis
#include <flint/decimal.h>int decfloat_set_round(decfloat_t res, const decfloat_t x, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_si(decfloat_t res, slong x, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_ui(decfloat_t res, ulong x, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_fmpz(decfloat_t res, const fmpz_t x, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_fmpq(decfloat_t res, const fmpq_t x, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_d(decfloat_t res, double x, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_str(decfloat_t res, const char * s, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_fmpz_10exp_fmpz(decfloat_t res, const fmpz_t m, const fmpz_t e, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_fmpz_2exp_fmpz(decfloat_t res, const fmpz_t m, const fmpz_t e, slong prec, int rnd, gr_ctx_t ctx)sourceint decfloat_set_round_arf(decfloat_t res, const arf_t x, slong prec, int rnd, gr_ctx_t ctx)sourceVersions with an explicit precision and rounding mode. Passing DECIMAL_PREC_EXACT sets the exact value.
Cite this page
The FLINT team, “decfloat_set_round, decfloat_set_round_si, decfloat_set_round_ui, decfloat_set_round_fmpz, decfloat_set_round_fmpq, decfloat_set_round_d, decfloat_set_round_str, decfloat_set_round_fmpz_10exp_fmpz, decfloat_set_round_fmpz_2exp_fmpz, decfloat_set_round_arf (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/decfloat_set_round.html (generated 2026-10-20).
@misc{flint-doc-decimal-decfloat-set-round,
author = {{The FLINT team}},
title = {{decfloat\_set\_round, decfloat\_set\_round\_si, decfloat\_set\_round\_ui, decfloat\_set\_round\_fmpz, decfloat\_set\_round\_fmpq, decfloat\_set\_round\_d, decfloat\_set\_round\_str, decfloat\_set\_round\_fmpz\_10exp\_fmpz, decfloat\_set\_round\_fmpz\_2exp\_fmpz, decfloat\_set\_round\_arf (decimal.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/decimal/decfloat_set_round.html},
note = {Generated 2026-10-20}
}