AuroraRuntime/Include/auROXTL/auNumberUtils.hpp

26 lines
515 B
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: auNumberUtils.hpp
Date: 2022-2-1
Author: Reece
***/
#pragma once
template<class T>
constexpr const T &AuMin(const T &a, const T &b)
{
return a < b ? a : b;
}
template<class T>
constexpr const T &AuMax(const T &a, const T &b)
{
return a < b ? b : a;
}
template<class T>
constexpr const T AuConstPow(const T base, const AuUInt8 exponent)
{
return exponent ? base * AuConstPow(base, exponent - 1) : 1;
}