FLINT3.7.0-dev

fmpzi_divrem

Synopsis#include <flint/fmpzi.h>
void fmpzi_divrem(fmpzi_t q, fmpzi_t r, const fmpzi_t x, const fmpzi_t y)source

Sets qq and rr to the quotient and remainder of xx by yy: x=qy+rx = qy + r, where qq is x/yx/y with both coordinates rounded to the nearest integer, ties rounded upwards. Then N(r)≤N(y)/2N(r) \le N(y)/2, and the pair is uniquely determined. r may be NULL. Throws if y=0y = 0.

Cite this page

The FLINT team, “fmpzi_divrem (fmpzi.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpzi/fmpzi_divrem.html (generated 2026-11-02).