padic_inv
Synopsis
#include <flint/padic.h>void padic_inv(padic_t rop, const padic_t op, const padic_ctx_t ctx)sourceSets rop to 1/op, reduced. For op = p^v u this is p^{-v} times the inverse of u modulo p^{N + v}, computed by Hensel lifting; if N + v \le 0 the result is zero. Throws if op is zero.
The inverse modulo p is computed by the extended Euclidean algorithm and lifted by the Newton iteration z \gets 2z - u z^2, which doubles the number of correct digits in each step (Hensel lifting of inverses, square roots and Teichmüller lifts). For p = 2 the iteration runs directly on the limbs (fmpz_invmod_2exp).
Guides#
Cite this page
The FLINT team, “padic_inv (padic.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/padic/padic_inv.html (generated 2026-10-20).
@misc{flint-doc-padic-padic-inv,
author = {{The FLINT team}},
title = {{padic\_inv (padic.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/padic/padic_inv.html},
note = {Generated 2026-10-20}
}