From 6f735880f3d4298800d7766ce119000f8e84da8f Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 7 Oct 2024 00:58:01 +0800 Subject: [PATCH] updated few codes of FLOAT MIN/MAX --- inc/hgl/math/MathConst.h | 11 +++++++---- inc/hgl/type/object/ObjectBaseInfo.h | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/inc/hgl/math/MathConst.h b/inc/hgl/math/MathConst.h index 53d2b4b..93f12fd 100644 --- a/inc/hgl/math/MathConst.h +++ b/inc/hgl/math/MathConst.h @@ -6,10 +6,13 @@ 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 =std::numeric_limits::epsilon(); ///<浮点数精度最小值 - constexpr const double HGL_DOUBLE_EPSILON =std::numeric_limits::epsilon(); ///<双精度浮点数精度最小值 + constexpr const float HGL_FLOAT_MIN =std::numeric_limits::min(); ///<最小浮点数 + constexpr const float HGL_FLOAT_MAX =std::numeric_limits::max(); ///<最大浮点数 + constexpr const float HGL_FLOAT_EPSILON =std::numeric_limits::epsilon(); ///<浮点数精度最小值 + + constexpr const double HGL_DOUBLE_MIN =std::numeric_limits::min(); ///<最小双精度浮点数 + constexpr const double HGL_DOUBLE_MAX =std::numeric_limits::max(); ///<最大双精度浮点数 + constexpr const double HGL_DOUBLE_EPSILON =std::numeric_limits::epsilon(); ///<双精度浮点数精度最小值 template bool IsNearlyZero(const T value); diff --git a/inc/hgl/type/object/ObjectBaseInfo.h b/inc/hgl/type/object/ObjectBaseInfo.h index 2879a92..245e897 100644 --- a/inc/hgl/type/object/ObjectBaseInfo.h +++ b/inc/hgl/type/object/ObjectBaseInfo.h @@ -6,13 +6,16 @@ namespace hgl { class ObjectManager; + /** + * 对象基本信息 + */ struct ObjectBaseInfo { size_t hash_code; ///<对象数据类型的hash值 ObjectManager * object_manager; ///<对象管理器 size_t serial_number; ///<对象序列号 - SourceCodeLocation source_code_location; + SourceCodeLocation source_code_location; ///<对象创建的源代码位置 }; }//namespace hgl