Expand description
LogBase2Of1PlusX and
LogBase2Of1PlusXAssign,
traits for computing $\log_2(1+x)$ for Floats.
Functions§
- primitive_
float_ log_ base_ 2_ 1_ plus_ x - Computes the base-2 logarithm of one plus a primitive float, $\log_2(1+x)$. Using this function
is more accurate than computing
(1 + x).log2(), both because $1+x$ may not be representable as a primitive float and because the standard library’slog2is not always correctly rounded.