FLINT3.7.0-dev

bernoulli_bound_2exp_si

Synopsis#include <flint/bernoulli.h>
slong bernoulli_bound_2exp_si(ulong n)source

Returns an integer b with |B_n| \le 2^b, using a table for n < 512 and otherwise the inequality |B_n| < 4\, n!/(2\pi)^n < 4 (n+1)^{n+1} e^{-n}/(2\pi)^n evaluated in integer arithmetic with a table of logarithms. Returns WORD_MIN if B_n = 0. The bound exceeds the true exponent by at most one percent. Throws if n > 2^{\mathtt{FLINT\_BITS} - 6} or the computation would overflow; the function is meant for n small enough that B_n could be computed exactly.

Cite this page

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