RandomLib
1.10
|
Return or multiply by powers of 2. More...
#include <RandomLib/RandomPower2.hpp>
Public Types | |
enum | { minpow = -64, maxpow = 64 } |
Static Public Member Functions | |
template<typename RealType > | |
static RealType | pow2 (int n) throw () |
template<typename RealType > | |
static RealType | shiftf (RealType x, int n) throw () |
Return or multiply by powers of 2.
With some compilers it's fastest to do a table lookup of powers of
Definition at line 26 of file RandomPower2.hpp.
anonymous enum |
Enumerator | |
---|---|
minpow |
Minimum power in RandomPower2::power2 |
maxpow |
Maximum power in RandomPower2::power2. |
Definition at line 55 of file RandomPower2.hpp.
|
inlinestatic |
Return powers of 2 (either using a lookup table or std::pow)
[in] | n | the integer power. |
Definition at line 34 of file RandomPower2.hpp.
|
inlinestatic |
Multiply a real by a power of 2
RealType | the type of x. |
[in] | x | the real number. |
[in] | n | the power (positive or negative). |
Definition at line 50 of file RandomPower2.hpp.