constexpr_log
Declared in <folly/ConstexprMath.h>
template<typename T>
requires std::floating_point<T>
constexpr
T
constexpr_log(T const num);
Calculates an approximation of the natural logarithm ln(num).
The implementation uses a quickly-converging, high-precision iterative technique as described in: https://en.wikipedia.org/wiki/Natural_logarithm#High_precision
The technique works best with numbers that are close enough to 1, so the implementation uses a quick shrink/growth technique as described in: https://en.wikipedia.org/wiki/Natural_logarithm#Efficient_computation
An approximation of the natural logarithm of num.
| Name | Description |
|---|---|
| num | The value whose natural logarithm is computed. |