maths: add namespaced wrappers
This commit is contained in:
parent
e12edc6c0a
commit
a342654ae1
17
maths.hpp
17
maths.hpp
@ -40,17 +40,26 @@ namespace util {
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// exponentials
|
// exponentials
|
||||||
|
|
||||||
template <typename T>
|
namespace util {
|
||||||
constexpr T
|
template <typename T>
|
||||||
pow2 [[gnu::pure]] (T value)
|
constexpr T
|
||||||
{ return value * value; }
|
pow2 [[gnu::pure]] (T value)
|
||||||
|
{ return value * value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T> constexpr T pow2 [[gnu::pure]] (T value) { return util::pow2 (value); }
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
constexpr T
|
constexpr T
|
||||||
pow [[gnu::pure]] (T x, unsigned y);
|
pow [[gnu::pure]] (T x, unsigned y);
|
||||||
|
|
||||||
|
namespace util {
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
constexpr T pow (T x, unsigned y) { return ::pow (x, y); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user