Embedded Template Library 1.0
Loading...
Searching...
No Matches
power

Classes

struct  etl::power< NV, POWER >
 
struct  etl::power_of_2_round_up< NV >
 
struct  etl::power_of_2_round_up< 0 >
 
struct  etl::power_of_2_round_down< NV >
 
struct  etl::power_of_2_round_down< 0 >
 
struct  etl::power_of_2_round_down< 1 >
 
struct  etl::power_of_2_round_down< 2 >
 
struct  etl::is_power_of_2< NV >
 
struct  etl::is_power_of_2< 0 >
 
struct  etl::is_power_of_2< 1 >
 

Detailed Description

power<N, POWER> : Calculates N to the power POWER.


Class Documentation

◆ etl::power

struct etl::power
template<size_t NV, size_t POWER>
struct etl::power< NV, POWER >

Calculates powers.

Note
Only supports positive N.

Static Public Attributes

static ETL_CONSTANT private_power::type value = NV * power<NV, POWER - 1>::value
 

◆ etl::power_of_2_round_up

struct etl::power_of_2_round_up
template<size_t NV>
struct etl::power_of_2_round_up< NV >

Calculates the rounded up power of 2.

Public Types

enum  value_type { value = 1 << (etl::log2<NV - 1>::value + 1) }
 

◆ etl::power_of_2_round_up< 0 >

struct etl::power_of_2_round_up< 0 >

Calculates the rounded up power of 2. Specialisation for 0.

Public Types

enum  value_type { value = 2 }
 

◆ etl::power_of_2_round_down

struct etl::power_of_2_round_down
template<size_t NV>
struct etl::power_of_2_round_down< NV >

Calculates the rounded down power of 2.

Public Types

enum  value_type { value = 1 << (etl::log2<NV - 1>::value) }
 

◆ etl::power_of_2_round_down< 0 >

struct etl::power_of_2_round_down< 0 >

Calculates the rounded down power of 2. Specialisation for 0.

Public Types

enum  value_type { value = 2 }
 

◆ etl::power_of_2_round_down< 1 >

struct etl::power_of_2_round_down< 1 >

Calculates the rounded down power of 2. Specialisation for 1.

Public Types

enum  value_type { value = 2 }
 

◆ etl::power_of_2_round_down< 2 >

struct etl::power_of_2_round_down< 2 >

Calculates the rounded down power of 2. Specialisation for 2.

Public Types

enum  value_type { value = 2 }
 

◆ etl::is_power_of_2

struct etl::is_power_of_2
template<size_t NV>
struct etl::is_power_of_2< NV >

Checks if N is a power of 2.

Static Public Attributes

static ETL_CONSTANT bool value = (NV & (NV - 1)) == 0
 

◆ etl::is_power_of_2< 0 >

struct etl::is_power_of_2< 0 >

Checks if N is a power of 2. Specialisation for 0.

Static Public Attributes

static ETL_CONSTANT bool value = false
 

◆ etl::is_power_of_2< 1 >

struct etl::is_power_of_2< 1 >

Checks if N is a power of 2. Specialisation for 1.

Static Public Attributes

static ETL_CONSTANT bool value = false