diff options
author | B. Stack <bgstack15@gmail.com> | 2022-05-22 21:09:26 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-05-22 21:09:26 +0000 |
commit | 54c2e44d7b37b2c3efc449e054eef21fa414dfde (patch) | |
tree | 3894ba7e10c78750c195381a861da5e8166a6bfd /zen/basic_math.h | |
parent | Merge branch 'b11.20' into 'master' (diff) | |
parent | add upstream 11.21 (diff) | |
download | FreeFileSync-11.21.tar.gz FreeFileSync-11.21.tar.bz2 FreeFileSync-11.21.zip |
Merge branch 'b11.21' into 'master'11.21
add upstream 11.21
See merge request opensource-tracking/FreeFileSync!44
Diffstat (limited to 'zen/basic_math.h')
-rw-r--r-- | zen/basic_math.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/zen/basic_math.h b/zen/basic_math.h index 944a0f53..c8a06b78 100644 --- a/zen/basic_math.h +++ b/zen/basic_math.h @@ -8,7 +8,6 @@ #define BASIC_MATH_H_3472639843265675 #include <cassert> -#include <algorithm> #include <cmath> #include <numbers> #include "type_traits.h" @@ -152,10 +151,10 @@ template <class N, class D> inline auto intDivRound(N num, D den) { using namespace zen; - static_assert(IsIntegerV<N>&& IsIntegerV<D>); - static_assert(IsSignedIntV<N> == IsSignedIntV<D>); //until further + static_assert(isInteger<N>&& isInteger<D>); + static_assert(isSignedInt<N> == isSignedInt<D>); //until further assert(den != 0); - if constexpr (IsSignedIntV<N>) + if constexpr (isSignedInt<N>) { if ((num < 0) != (den < 0)) return (num - den / 2) / den; @@ -168,10 +167,10 @@ template <class N, class D> inline auto intDivCeil(N num, D den) { using namespace zen; - static_assert(IsIntegerV<N>&& IsIntegerV<D>); - static_assert(IsSignedIntV<N> == IsSignedIntV<D>); //until further + static_assert(isInteger<N>&& isInteger<D>); + static_assert(isSignedInt<N> == isSignedInt<D>); //until further assert(den != 0); - if constexpr (IsSignedIntV<N>) + if constexpr (isSignedInt<N>) { if ((num < 0) != (den < 0)) return num / den; @@ -187,10 +186,10 @@ template <class N, class D> inline auto intDivFloor(N num, D den) { using namespace zen; - static_assert(IsIntegerV<N>&& IsIntegerV<D>); - static_assert(IsSignedIntV<N> == IsSignedIntV<D>); //until further + static_assert(isInteger<N>&& isInteger<D>); + static_assert(isSignedInt<N> == isSignedInt<D>); //until further assert(den != 0); - if constexpr (IsSignedIntV<N>) + if constexpr (isSignedInt<N>) { if ((num < 0) != (den < 0)) { |