FLINT3.7.0-dev

dlog_once

Synopsis#include <flint/dlog.h>
ulong dlog_once(ulong b, ulong a, const nmod_t mod, ulong n)source

Returns x with a^x \equiv b modulo mod.n, where a has order n: by enumerating the powers of a for n < 50 (throwing if b is not found), and otherwise with a precomputation for one query (dlog_precomp_n_init with num = 1), which is cleared afterwards.

Cite this page

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