libjmmcg
build_2783
A C++ library containing an eclectic mix of useful, advanced components.
|
The class to compute the result of raising a value V to an integer power P, at compile-time. More...
#include <integer_power.hpp>
Inherits binary_function< long, long, long >.
Static Public Attributes | |
static constexpr long | power =P |
The power to which the value should be raised. More... | |
static constexpr long | value =V |
The value to exponentiate. Negative powers are computed as 1/V^|P|. More... | |
static constexpr long | result =(sign<power>::result ? int_result : 1/int_result) |
The class to compute the result of raising a value V to an integer power P, at compile-time.
The runtime algorithmic-complexity of this function is O(1). The compile-time algorithmic complexity of this function is O(lg(power)+v(power)), where v(power) is the number of 1s in the binary representation of power.
Definition at line 202 of file integer_power.hpp.
|
staticconstexpr |
The power to which the value should be raised.
Definition at line 231 of file integer_power.hpp.
|
staticconstexpr |
Definition at line 239 of file integer_power.hpp.
|
staticconstexpr |
The value to exponentiate. Negative powers are computed as 1/V^|P|.
Definition at line 232 of file integer_power.hpp.