Loading...
Searching...
No Matches
log

## Classes

struct | etl::log< Value, Base >
struct | etl::log2< Value >
struct | etl::log10< Value >

## Detailed Description

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.

## Class Documentation

## etl::log

struct etl::log

template<size_t Value, size_t Base>
struct etl::log< Value, 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

  Value | The number to find the log of.
  Base | The base of the log.

### Public Types

enum | value_type { value = (Value >= Base) ? 1 + log<Value / Base, Base>::value : 0 }

## etl::log2

struct etl::log2

template<size_t Value>
struct etl::log2< Value >

Calculates base 2 logs.

### Public Types

enum | value_type { value = log<Value, 2>::value }

## etl::log10

struct etl::log10

template<size_t Value>
struct etl::log10< Value >

Calculates base 10 logs.

### Public Types

enum | value_type { value = log<Value, 10>::value }