FLINT3.7.0-dev

arf_div, arf_div_ui, arf_ui_div, arf_div_si, arf_si_div, arf_div_fmpz, arf_fmpz_div, arf_fmpz_div_fmpz

Synopsis#include <flint/arf.h>
int arf_div(arf_ptr z, arf_srcptr x, arf_srcptr y, slong prec, arf_rnd_t rnd)source
int arf_div_ui(arf_ptr z, arf_srcptr x, ulong y, slong prec, arf_rnd_t rnd)source
int arf_ui_div(arf_ptr z, ulong x, arf_srcptr y, slong prec, arf_rnd_t rnd)source
int arf_div_si(arf_ptr z, arf_srcptr x, slong y, slong prec, arf_rnd_t rnd)source
int arf_si_div(arf_ptr z, slong x, arf_srcptr y, slong prec, arf_rnd_t rnd)source
int arf_div_fmpz(arf_ptr z, arf_srcptr x, const fmpz_t y, slong prec, arf_rnd_t rnd)source
int arf_fmpz_div(arf_ptr z, const fmpz_t x, arf_srcptr y, slong prec, arf_rnd_t rnd)source
int arf_fmpz_div_fmpz(arf_ptr z, const fmpz_t x, const fmpz_t y, slong prec, arf_rnd_t rnd)source

Set z to x / y, correctly rounded for the strict modes. Division by zero gives NaN. The relaxed modes ARF_RND_FAST and ARF_RND_ACCURATE are accepted.

The standard algorithm computes a truncated quotient with at least 32 extra bits (flint_mpn_tdiv_q) and decides exactness by multiplying back only when the low bits of the quotient are zero. Division by a power of two is a rounding of the numerator. With a relaxed mode and a large precision, Newton iteration from mp_real is used instead (see ARF_RND_FAST).

Guides#

Cite this page

The FLINT team, “arf_div, arf_div_ui, arf_ui_div, arf_div_si, arf_si_div, arf_div_fmpz, arf_fmpz_div, arf_fmpz_div_fmpz (arf.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arf/arf_div.html (generated 2026-10-20).