FLINT3.7.0-dev

FLINT_BIT_COUNT

Synopsis#include <flint/longlong.h>
flint_bitcnt_t FLINT_BIT_COUNT(ulong x)source

Returns the number of bits of x, that is, \lfloor \log_2 x \rfloor + 1 for x \ge 1, and 0 for x = 0. The result is unsigned, so expressions such as FLINT_BIT_COUNT(x) - 1 wrap around for x = 0.

Guides#

Cite this page

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