FLINT3.7.0-dev

decfloat_is_zero, decfloat_is_one, decfloat_is_neg_one, decfloat_equal, decfloat_is_integer, decfloat_cmp, decfloat_cmpabs, decfloat_sgn

Synopsis#include <flint/decimal.h>
truth_t decfloat_is_zero(const decfloat_t x, gr_ctx_t ctx)source
truth_t decfloat_is_one(const decfloat_t x, gr_ctx_t ctx)source
truth_t decfloat_is_neg_one(const decfloat_t x, gr_ctx_t ctx)source
truth_t decfloat_equal(const decfloat_t x, const decfloat_t y, gr_ctx_t ctx)source
truth_t decfloat_is_integer(const decfloat_t x, gr_ctx_t ctx)source
int decfloat_cmp(int * res, const decfloat_t x, const decfloat_t y, gr_ctx_t ctx)source
int decfloat_cmpabs(int * res, const decfloat_t x, const decfloat_t y, gr_ctx_t ctx)source
int decfloat_sgn(decfloat_t res, const decfloat_t x, gr_ctx_t ctx)source

Predicates and comparisons following the gr conventions: predicates return T_UNKNOWN for NaN, comparisons return GR_UNABLE for NaN (and GR_DOMAIN for infinities when the context does not allow them). A number is an integer iff its limb exponent is nonnegative; infinities are not integers.

Guides#

Cite this page

The FLINT team, “decfloat_is_zero, decfloat_is_one, decfloat_is_neg_one, decfloat_equal, decfloat_is_integer, decfloat_cmp, decfloat_cmpabs, decfloat_sgn (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/decfloat_is_zero.html (generated 2026-10-20).