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 xx with ax≡ba^x \equiv b modulo mod.n, where aa has order nn: by enumerating the powers of aa for n<50n < 50 (throwing if bb is not found), and otherwise with a precomputation for one query (dlog_precomp_n_init with num =1= 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-11-02).