From 381da163e24b09d585329fde8a4eb4a10db1f85a Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 16 Sep 2015 02:24:49 +1000 Subject: [PATCH] maths: style --- maths.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);