3 #ifndef FORPY_UTIL_EXPONENTIALS_H_ 4 #define FORPY_UTIL_EXPONENTIALS_H_ 12 static const double D_PI = 4. * atan(1.);
16 static const float TWO_PI =
static_cast<float>(2. *
D_PI);
18 #pragma clang diagnostic push 19 #pragma clang diagnostic ignored "-Wunused-variable" 23 #pragma clang diagnostic pop 35 inline int ipow(
int base,
unsigned int exp) {
56 inline float fpowi(
float base,
unsigned int exp) {
65 return base * base * base;
67 return base * base * base * base;
69 return base * base * base * base * base;
83 #endif // FORPY_UTIL_EXPONENTIALS_H_
float fpowi(float base, unsigned int exp)
Computes a float power by an unsigned int.
static const float TWO_PI_E
static const float TWO_PI
int ipow(int base, unsigned int exp)
Computes an int power by an int.