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;