From 2b0d8b5af5f96e7f39530520611aba7713a0c4a7 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 13 May 2024 19:57:21 +0800 Subject: [PATCH] Added MathConst.h in CMakeLists.txt --- inc/hgl/math/MathConst.h | 12 ++++++++++++ src/CMakeLists.txt | 1 + 2 files changed, 13 insertions(+) diff --git a/inc/hgl/math/MathConst.h b/inc/hgl/math/MathConst.h index 659ea84..9916d3b 100644 --- a/inc/hgl/math/MathConst.h +++ b/inc/hgl/math/MathConst.h @@ -5,6 +5,18 @@ namespace hgl { + constexpr const float HGL_FLOAT_MIN =1.175494351e-38f; ///<最小浮点数 + constexpr const float HGL_FLOAT_MAX =3.402823466e+38f; ///<最大浮点数 + constexpr const float HGL_FLOAT_EPSILON =1.192092896e-07f; ///<浮点数精度 + constexpr const float HGL_FLOAT_ZERO =0.000001f; ///<浮点数零值 + constexpr const float HGL_FLOAT_KINDA_SMALL =1.e-4f; ///<浮点数很小值 + constexpr const float HGL_FLOAT_SMALL =1.e-8f; ///<浮点数小值 + + template bool IsNearlyZero(const T value) + { + return(abs(value)