FLINT3.7.0-dev

gr_generic_bernoulli_ui, gr_generic_bernoulli_fmpz, gr_generic_bernoulli_vec

Synopsis#include <flint/gr_generic.h>
int gr_generic_bernoulli_ui(gr_ptr res, ulong n, gr_ctx_t ctx)source
int gr_generic_bernoulli_fmpz(gr_ptr res, const fmpz_t n, gr_ctx_t ctx)source
int gr_generic_bernoulli_vec(gr_ptr res, slong len, gr_ctx_t ctx)source

Defaults of gr_bernoulli_ui and the related functions: in \mathbb{Q}, the exact Bernoulli numbers from bernoulli_fmpq_ui and the global cache of bernoulli; in rings with a real precision, numerical values computed with arb_bernoulli_ui (or arb_bernoulli_fmpz) and converted; otherwise exact rational values converted with gr_set_fmpq, which fails if a denominator is not invertible. gr_generic_bernoulli_fmpz returns GR_UNABLE for huge n in exact rings.

Cite this page

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