summaryrefslogtreecommitdiff
path: root/zen/basic_math.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2025-01-20 19:25:18 -0500
committerB. Stack <bgstack15@gmail.com>2025-01-20 19:25:18 -0500
commitde65d3c0295894f8eafc4c7582dfe180dc58c81e (patch)
tree3ba8ec770b81468ca4ad83d985b991c5f669de22 /zen/basic_math.h
parentadd upstream 13.9 (diff)
downloadFreeFileSync-de65d3c0295894f8eafc4c7582dfe180dc58c81e.tar.gz
FreeFileSync-de65d3c0295894f8eafc4c7582dfe180dc58c81e.tar.bz2
FreeFileSync-de65d3c0295894f8eafc4c7582dfe180dc58c81e.zip
add upstream 14.0, depends on wx 3.3.0HEAD14.0master
Diffstat (limited to 'zen/basic_math.h')
-rw-r--r--zen/basic_math.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/zen/basic_math.h b/zen/basic_math.h
index 77ce7b7e..9080d07d 100644
--- a/zen/basic_math.h
+++ b/zen/basic_math.h
@@ -27,7 +27,7 @@ template <class N, class D> auto intDivCeil (N numerator, D denominator);
template <class N, class D> auto intDivFloor(N numerator, D denominator);
template <size_t N, class T>
-T power(T value);
+constexpr T power(T value);
double radToDeg(double rad); //convert unit [rad] into [°]
double degToRad(double degree); //convert unit [°] into [rad]
@@ -207,12 +207,12 @@ namespace
{
template <size_t N, class T> struct PowerImpl;
//let's use non-recursive specializations to help the compiler
-template <class T> struct PowerImpl<2, T> { static T result(T value) { return value * value; } };
-template <class T> struct PowerImpl<3, T> { static T result(T value) { return value * value * value; } };
+template <class T> struct PowerImpl<2, T> { static constexpr T result(T value) { return value * value; } };
+template <class T> struct PowerImpl<3, T> { static constexpr T result(T value) { return value * value * value; } };
}
template <size_t N, class T> inline
-T power(T value)
+constexpr T power(T value)
{
return PowerImpl<N, T>::result(value);
}
bgstack15