gr_ctx_init_decfloat, gr_ctx_init_decball, gr_ctx_init_deccfloat, gr_ctx_init_deccball
#include <flint/decimal.h>Initializes ctx to the ring of decimal floating-point numbers, decimal balls, complex decimal floating-point numbers, respectively complex decimal balls, with default precision prec digits (at least 1) and the given flags. The default rounding mode is DECIMAL_RND_NEAR (for both real and imaginary parts) and the radius precision is DECMAG_DEFAULT_PREC digits. Exponents are unbounded. The largest possible limb radix is used.
Passing DECIMAL_PREC_EXACT as the precision gives the exact ring \mathbb{Z}[1/10] of decimal fractions: no rounding is ever performed, and inexact operations (division by 3, square roots of non-squares) return GR_UNABLE. Additions of operands whose exponents are astronomically far apart also return GR_UNABLE in this mode rather than allocating huge mantissas.
Guides#
The FLINT team, “gr_ctx_init_decfloat, gr_ctx_init_decball, gr_ctx_init_deccfloat, gr_ctx_init_deccball (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/gr_ctx_init_decfloat.html (generated 2026-10-20).
@misc{flint-doc-decimal-gr-ctx-init-decfloat,
author = {{The FLINT team}},
title = {{gr\_ctx\_init\_decfloat, gr\_ctx\_init\_decball, gr\_ctx\_init\_deccfloat, gr\_ctx\_init\_deccball (decimal.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/decimal/gr_ctx_init_decfloat.html},
note = {Generated 2026-10-20}
}