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)