FLINT3.7.0-dev

arb_bernoulli_ui, arb_bernoulli_fmpz

Synopsis#include <flint/arb.h>
void arb_bernoulli_ui(arb_t b, ulong n, slong prec)source
void arb_bernoulli_fmpz(arb_t b, const fmpz_t n, slong prec)source

Set b to the Bernoulli number B_n to prec bits of accuracy.

The working precision is increased automatically. If B_n is in the global cache (see bernoulli_cache_compute) or its exact numerator has about prec bits or more, the exact fraction is divided once; otherwise B_n is computed from \zeta(n) by arb_bernoulli_ui_zeta. The functions read the cache but do not extend it. A huge fmpz index gives a result with a huge exponent, which is slower. The methods are described in Bernoulli numbers.

Cite this page

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