FLINT3.7.0-dev

mag_set_d, mag_set_ui, mag_set_fmpz

Synopsis#include <flint/mag.h>
void mag_set_d(mag_t res, double x)source
void mag_set_ui(mag_t res, ulong x)source
void mag_set_fmpz(mag_t res, const fmpz_t x)source

Set res to an upper bound for |x|. The result can be larger than |x| even when |x| is representable: mag_set_d always adds one unit in the 30th bit. A NaN double gives +\infty.

Guides#

Cite this page

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