FLINT3.7.0-dev

mag_get_fmpq, mag_get_fmpz, mag_get_fmpz_lower

Synopsis#include <flint/mag.h>
void mag_get_fmpq(fmpq_t res, const mag_t x)source
void mag_get_fmpz(fmpz_t res, const mag_t x)source
void mag_get_fmpz_lower(fmpz_t res, const mag_t x)source

Set res to the exact value of x, to \lceil x \rceil, and to \lfloor x \rfloor respectively.

The caller must make sure that x has a reasonable size. An infinite x or one with a huge exponent raises an exception, and an exponent that is merely large can exhaust memory.

Cite this page

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