From e371f151789f05145b6b00cd937cbfc787b52d3f Mon Sep 17 00:00:00 2001 From: hyzboy Date: Sun, 4 Aug 2024 00:55:50 +0800 Subject: [PATCH] removed FLOAT_KINDA_SMALL macro --- inc/hgl/math/MathConst.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/inc/hgl/math/MathConst.h b/inc/hgl/math/MathConst.h index 4eec878..60cf3ee 100644 --- a/inc/hgl/math/MathConst.h +++ b/inc/hgl/math/MathConst.h @@ -9,17 +9,16 @@ namespace hgl 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; ///<浮点数小值 + constexpr const float HGL_FLOAT_SMALL =1.e-6f; ///<浮点数小值 template bool IsNearlyZero(const T value) { - return(abs(value)<=HGL_FLOAT_KINDA_SMALL); + return(abs(value)<=HGL_FLOAT_SMALL); } template bool IsNearlyEqual(const T a,const T b) { - return(abs(a-b)<=HGL_FLOAT_KINDA_SMALL); + return(abs(a-b)<=HGL_FLOAT_SMALL); } constexpr const double HGL_E =2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274; //欧拉数(自然对数的底数)