From d40e79ae29310323fa518573e5a6cb3e5a6e0b7d Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 7 Oct 2021 19:08:34 -0600 Subject: [PATCH] mathlib: revert Q_rint to match master The one on master returns 0 ==Q_rint(-0) whereas the std::rint returns -0 == Q_rint(-0) --- include/common/mathlib.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/common/mathlib.hh b/include/common/mathlib.hh index 78cf45a3..0cfa7c89 100644 --- a/include/common/mathlib.hh +++ b/include/common/mathlib.hh @@ -165,7 +165,11 @@ void AddPointToBounds(const vec3_t v, vec3_t mins, vec3_t maxs); plane_t FlipPlane(plane_t input); -#define Q_rint rint +template +inline T Q_rint(T in) +{ + return (T)(floor(in + 0.5)); +} /* Random()