# Group Metaprogramming Math
Metafunctions for mathematical computations.

## Grouped Metafunction Overview

- `uint64_t Log2<NUMERUS>::VALUE;`
  Compute ceiled logarithm to base 2 using metaprogramming.
- `uint64_t Log2Floor<NUMERUS>::VALUE;`
  Compute floored logarithm to base 2 using metaprogramming.
- `uint64_t Power<BASE, EXPONENT>::VALUE;`
  Compute power of a number.

## Grouped Metafunctions Detail

### `uint64_t Log2<NUMERUS>::VALUE;`

Compute ceiled logarithm to base 2 using metaprogramming.

#### Template Parameters

`NUMERUS` | `int64_t` value to use for the numerus.

#### Returns

`uint64_t` | `ceil(log2(NUMERUS))`

#### Example

        std::cout << Log2<10>::VALUE << "\n";  // => "4"

Snippet from: demos/dox/basic/metaprogramming_math.cpp

### `uint64_t Log2Floor<NUMERUS>::VALUE;`

Compute floored logarithm to base 2 using metaprogramming.

#### Template Parameters

`NUMERUS` | `int64_t` value to use for the numerus.

#### Returns

`uint64_t` | `floor(log2(NUMERUS))`

#### Example

        std::cout << Log2Floor<10>::VALUE << "\n";  // => "3""

Snippet from: demos/dox/basic/metaprogramming_math.cpp

### `uint64_t Power<BASE, EXPONENT>::VALUE;`

Compute power of a number.

#### Template Parameters

`BASE` | The base of the term (`int64_t`).
`EXPONENT` | The exponent of the term (`int64_t`).

#### Returns

`uint64_t` | BASEEXPONENT

        std::cout << Power<2, 4>::VALUE << "\n";  // => "16"

Snippet from: demos/dox/basic/metaprogramming_math.cpp

#### Dox Sources

    /*!
     * @defgroup MetaprogrammingMath Metaprogramming Math
     *
     * @brief Metafunctions for mathematical computations.
     *
     * @mfn MetaprogrammingMath#Log2
     *
     * @brief Compute ceiled logarithm to base 2 using metaprogramming.
     *
     * @signature uint64_t Log2<NUMERUS>::VALUE;
     *
     * @tparam NUMERUS <tt>int64_t</tt> value to use for the numerus.
     *
     * @return uint64_t <tt>ceil(log2(NUMERUS))</tt>
     *
     * @section Example
     *
     * @snippet demos/dox/basic/metaprogramming_math.cpp log2 call
     *
     *
     *
     * @mfn MetaprogrammingMath#Log2Floor
     *
     * @brief Compute floored logarithm to base 2 using metaprogramming.
     *
     * @signature uint64_t Log2Floor<NUMERUS>::VALUE;
     *
     * @tparam NUMERUS <tt>int64_t</tt> value to use for the numerus.
     *
     * @return uint64_t <tt>floor(log2(NUMERUS))</tt>
     *
     * @section Example
     *
     * @snippet demos/dox/basic/metaprogramming_math.cpp log2floor call
     *
     *
     *
     * @mfn MetaprogrammingMath#Power
     *
     * @brief Compute power of a number.
     *
     * @signature uint64_t Power<BASE, EXPONENT>::VALUE;
     *
     * @tparam BASE The base of the term (<tt>int64_t</tt>).
     * @tparam EXPONENT The exponent of the term (<tt>int64_t</tt>).
     *
     * @return uint64_t BASE<sup>EXPONENT</sup>
     *
     * @snippet demos/dox/basic/metaprogramming_math.cpp power call
     */