FLINT3.7.0-dev

deccfloat_struct, deccfloat_t

Synopsis#include <flint/decimal.h>
deccfloat_struct
deccfloat_t

A complex number a + bi stored as a pair of real (field re) and imaginary (field im) parts of type decfloat_struct, in the same way as acf. The real and imaginary parts are rounded separately to the context precision, the real part in the mode DECIMAL_CTX_RND and the imaginary part in the mode DECIMAL_CTX_RND_IM (which is the same mode unless changed with decimal_ctx_set_rnd_im).

Special values are per component: with DECIMAL_ALLOW_INF and DECIMAL_ALLOW_NAN a number can be, say, \infty + 2i or 1 + \mathrm{NaN} \cdot i, and a number is finite if both parts are. A real number is one with a zero imaginary part; there are no signed zeros.

The ring is presented to the generics interface in the same way as the real floating-point ring (the exact ring \mathbb{Z}[1/10][i] when the precision is exact and no special values are admitted, and otherwise a non-ring), with GR_METHOD_I, GR_METHOD_CONJ, GR_METHOD_RE, GR_METHOD_IM, GR_METHOD_ABS, GR_METHOD_SGN, GR_METHOD_CSGN and GR_METHOD_ARG implemented. Comparison (cmp) is only defined for real numbers (GR_DOMAIN otherwise), while cmpabs compares the exactly computed squared moduli. Rounding to integers (floor, ceil, trunc, nint) likewise requires real input.

Cite this page

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