From e5e0f11ed47ef9544ec2bef945db32b15c817182 Mon Sep 17 00:00:00 2001 From: AMS21 Date: Thu, 9 Nov 2023 10:42:29 +0100 Subject: [PATCH] xrCore: Fix definitions of `type_min` and `type_zero` and add `type_lowest` --- src/xrCore/xr_types.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/xrCore/xr_types.h b/src/xrCore/xr_types.h index 9bcbb8cb7a5..24980c59bb4 100644 --- a/src/xrCore/xr_types.h +++ b/src/xrCore/xr_types.h @@ -29,10 +29,13 @@ template constexpr auto type_max = std::numeric_limits::max(); template -constexpr auto type_min = -std::numeric_limits::max(); +constexpr auto type_lowest = std::numeric_limits::lowest(); template -constexpr auto type_zero = std::numeric_limits::min(); +constexpr auto type_min = std::numeric_limits::min(); + +template +constexpr auto type_zero = T(0); template constexpr auto type_epsilon = std::numeric_limits::epsilon(); @@ -43,16 +46,18 @@ constexpr int int_zero = type_zero; constexpr float flt_max = type_max; constexpr float flt_min = type_min; +constexpr float flt_lowest = type_lowest; constexpr float flt_zero = type_zero; constexpr float flt_eps = type_epsilon; #undef FLT_MAX #undef FLT_MIN #define FLT_MAX flt_max -#define FLT_MIN flt_min +#define FLT_MIN flt_lowest constexpr double dbl_max = type_max; constexpr double dbl_min = type_min; +constexpr double dbl_lowest = type_lowest; constexpr double dbl_zero = type_zero; constexpr double dbl_eps = type_epsilon;