From 6dc5194895b6bd61d19bf5c95021471784084325 Mon Sep 17 00:00:00 2001 From: untodesu Date: Tue, 1 Jul 2025 03:23:05 +0500 Subject: I forgot to set these to true in .clang-format https://files.catbox.moe/909rig.gif --- core/math/constexpr.hh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'core/math') diff --git a/core/math/constexpr.hh b/core/math/constexpr.hh index 3e4fcfa..263a6e8 100644 --- a/core/math/constexpr.hh +++ b/core/math/constexpr.hh @@ -46,7 +46,8 @@ constexpr static inline const T math::abs(const T x) { if(x < static_cast(0)) { return -x; - } else { + } + else { return x; } } @@ -64,7 +65,8 @@ constexpr static inline const T math::ceil(const F x) if(ival < x) { return ival + static_cast(1); - } else { + } + else { return ival; } } @@ -82,7 +84,8 @@ constexpr static inline const T math::floor(const F x) if(ival > x) { return ival - static_cast(1); - } else { + } + else { return ival; } } @@ -92,9 +95,11 @@ constexpr static inline const T math::clamp(const T x, const T min, const T max) { if(x < min) { return min; - } else if(x > max) { + } + else if(x > max) { return max; - } else { + } + else { return x; } } @@ -110,7 +115,8 @@ constexpr static inline const T math::log2(const T x) { if(x < 2) { return 0; - } else { + } + else { return math::log2((x + 1) >> 1) + 1; } } @@ -120,7 +126,8 @@ constexpr static inline const T math::max(const T x, const T y) { if(x < y) { return y; - } else { + } + else { return x; } } @@ -130,7 +137,8 @@ constexpr static inline const T math::min(const T x, const T y) { if(x > y) { return y; - } else { + } + else { return x; } } @@ -143,7 +151,8 @@ constexpr static inline const T math::mod_signed(const T x, const T m) if(result < T(0)) { return result + m; - } else { + } + else { return result; } } @@ -174,9 +183,11 @@ constexpr static inline const T math::sign(const F x) { if(x < F(0)) { return T(-1); - } else if(x > F(0)) { + } + else if(x > F(0)) { return T(+1); - } else { + } + else { return T(0); } } -- cgit