From 0afaae72ac6c31b5f5cd0c43dbc27705e6d18150 Mon Sep 17 00:00:00 2001 From: Medusa Slockbower Date: Wed, 2 Jul 2025 18:23:53 -0400 Subject: [PATCH] - Micro Optimization --- include/fennec/math/common.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/fennec/math/common.h b/include/fennec/math/common.h index f2a99d6..19c4ef9 100644 --- a/include/fennec/math/common.h +++ b/include/fennec/math/common.h @@ -461,12 +461,13 @@ constexpr genType roundEven(genType x) //bool up = r - fennec::floor(r) > e; //return i + static_cast(up); static const genType e = std::numeric_limits::epsilon(); - genType i = fennec::floor(x); + int I = static_cast(x); + genType i = static_cast(I); genType f = x - i; if (abs(f - genType(0.5)) > e) return fennec::round(x); - bool dir = (static_cast(x) % 2); + bool dir = (I % 2); return dir ? i + 1 : i; }