57 INLINE
unsigned long intPow(
unsigned long base,
unsigned long exponent) {
58 if (exponent == 0) {
return 1UL; }
60 unsigned long out = base;
62 for (
unsigned long i = 1; i < exponent; i++)
70 INLINE uint64_t
int2Pow(uint64_t exponent) {
72 return static_cast< uint64_t
>(1) << exponent;
79 INLINE
void superiorPow(
unsigned long card,
unsigned long& num_bits,
unsigned long& new_card) {
89 while (new_card < card) {
Exception : out of bound.
#define GUM_ERROR(type, msg)
uint64_t int2Pow(uint64_t exponent)
Specialized base 2 pow function with integer.
unsigned long intPow(unsigned long base, unsigned long exponent)
Specialized pow function with integers (faster implementation).
void superiorPow(unsigned long card, unsigned long &num_bits, unsigned long &new_card)
Compute the superior and closest power of two of an integer.
gum is the global namespace for all aGrUM entities
Implementation of pow functions with integers, faster than stl implementation.