Integer exponentiation function template.
More...
#include <assert.h>
Go to the source code of this file.
|
template<typename T > |
T | mlib::ipow (T base, int exp) |
| Integer exponentiation function.
|
|
template<> |
double | mlib::ipow (double base, int exp) |
| Specialization for double, can handle negative exponents.
|
|
template<typename T > |
T | mlib::squared (T base) |
| Return squared value of argument: baseĀ²
|
|
template<typename T > |
T | mlib::cubed (T base) |
| Return the cubed value of argument: baseĀ³
|
|
Integer exponentiation function template.