diff --git a/maths.hpp b/maths.hpp index 93ba08fc..250f3084 100644 --- a/maths.hpp +++ b/maths.hpp @@ -37,19 +37,22 @@ namespace util { } -//----------------------------------------------------------------------------- -// Exponentials +/////////////////////////////////////////////////////////////////////////////// +// exponentials + template constexpr T pow2 [[gnu::pure]] (T value) { return value * value; } +//----------------------------------------------------------------------------- template constexpr T pow [[gnu::pure]] (T x, unsigned y); +//----------------------------------------------------------------------------- template bool is_pow2 [[gnu::pure]] (T value);