log<N, BASE> : Calculates logs to any base, rounded down to the nearest integer.
log2<N> : Calculates logs to base 2, rounded down to the nearest integer.
log10<N> : Calculates logs to base 10, rounded down to the nearest integer.
◆ etl::log
template<
size_t NV,
size_t BASE>
struct etl::log< NV, BASE >
The base generic log template. Defines value as the log of the number at the specified base. The result is rounded down to the next integer.
- Template Parameters
-
NV | The number to find the log of. |
BASE | The base of the log. |
Public Types |
enum | value_type { value = (NV >= BASE) ? 1 + log<NV / BASE, BASE>::value : 0
} |
|
◆ etl::log2
template<
size_t NV>
struct etl::log2< NV >
Calculates base 2 logs.
Public Types |
enum | value_type { value = log<NV, 2>::value
} |
|
◆ etl::log10
template<
size_t NV>
struct etl::log10< NV >
Calculates base 10 logs.
Public Types |
enum | value_type { value = log<NV, 10>::value
} |
|