FLINT3.7.0-dev

nfloat_set_ui, nfloat_set_si, nfloat_set_fmpz, nfloat_set_fmpq, nfloat_set_d

Synopsis#include <flint/nfloat.h>
int nfloat_set_ui(nfloat_ptr res, ulong x, gr_ctx_t ctx)source
int nfloat_set_si(nfloat_ptr res, slong x, gr_ctx_t ctx)source
int nfloat_set_fmpz(nfloat_ptr res, const fmpz_t x, gr_ctx_t ctx)source
int nfloat_set_fmpq(nfloat_ptr res, const fmpq_t v, gr_ctx_t ctx)source
int nfloat_set_d(nfloat_ptr res, double x, gr_ctx_t ctx)source

Set res to an integer, a rational number or a double, rounded to the precision of the context (toward zero, or in the direction of the context's directed rounding).

Guides#

Cite this page

The FLINT team, “nfloat_set_ui, nfloat_set_si, nfloat_set_fmpz, nfloat_set_fmpq, nfloat_set_d (nfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nfloat/nfloat_set_ui.html (generated 2026-10-20).