FLINT3.7.0-dev

_gr_ore_poly_divrem, gr_ore_poly_divrem, gr_ore_poly_div, gr_ore_poly_rem

Synopsis#include <flint/gr_ore_poly.h>
int _gr_ore_poly_divrem(gr_ptr Q, gr_ptr R, gr_srcptr U, slong lenU, gr_srcptr V, slong lenV, gr_ore_poly_ctx_t ctx)source
int gr_ore_poly_divrem(gr_ore_poly_t Q, gr_ore_poly_t R, const gr_ore_poly_t U, gr_ore_poly_t V, gr_ore_poly_ctx_t ctx)source
int gr_ore_poly_div(gr_ore_poly_t Q, const gr_ore_poly_t U, gr_ore_poly_t V, gr_ore_poly_ctx_t ctx)source
int gr_ore_poly_rem(gr_ore_poly_t R, const gr_ore_poly_t U, gr_ore_poly_t V, gr_ore_poly_ctx_t ctx)source

Compute the right Euclidean division U=QV+RU = QV + R with ord⁡R<ord⁡V\operatorname{ord} R < \operatorname{ord} V, which exists and is unique when the leading coefficient of VV and its images under the powers of σ\sigma are invertible (over a field with σ\sigma injective, for instance). Each step divides the leading coefficient of the current remainder by σk(lc⁡(V))\sigma^k(\operatorname{lc}(V)) and subtracts cDkVc D^k V, for kk from ord⁡U−ord⁡V\operatorname{ord} U - \operatorname{ord} V down to 0; the eliminated coefficients of RR are then set to exact zeros (in inexact rings they would otherwise only be approximately zero). The non-underscore functions return GR_DOMAIN if V=0V = 0; the underscore version requires lenU≥lenV≥1\mathit{lenU} \ge \mathit{lenV} \ge 1 and writes lenU−lenV+1\mathit{lenU} - \mathit{lenV} + 1 coefficients of QQ and lenU\mathit{lenU} of RR. (In FLINT 3.6 and earlier the last step, k=0k = 0, was skipped, so that for example D2+D+1D^2 + D + 1 divided by DD gave Q=DQ = D and R=1+DR = 1 + D.)

Cite this page

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