d_log2
Synopsis
#include <flint/double_extras.h>double d_log2(double x)sourceReturns an approximation of \log_2 x, computed as log(x) divided by the double nearest to \log 2, so with an error of a few ulps. The result is not exact for all powers of two: for x = 2^{-1023} it is -1023.0000000000001. Special values and domain errors are those of log.
Cite this page
The FLINT team, “d_log2 (double_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/double_extras/d_log2.html (generated 2026-10-20).
@misc{flint-doc-double-extras-d-log2,
author = {{The FLINT team}},
title = {{d\_log2 (double\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/double_extras/d_log2.html},
note = {Generated 2026-10-20}
}