Skip to content

Commit

Permalink
add float.equal_epsilon and double.equal_epsilon
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 committed Sep 6, 2023
1 parent 7fee89d commit 45334c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common/engine/namedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ xx(Max)
xx(Min_Normal)
xx(Min_Denormal)
xx(Epsilon)
xx(Equal_Epsilon)
xx(NaN)
xx(Infinity)
xx(Dig)
Expand Down
2 changes: 2 additions & 0 deletions src/common/scripting/core/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ void PFloat::SetDoubleSymbols()
{ NAME_Min_Normal, DBL_MIN },
{ NAME_Max, DBL_MAX },
{ NAME_Epsilon, DBL_EPSILON },
{ NAME_Equal_Epsilon, EQUAL_EPSILON },
{ NAME_NaN, std::numeric_limits<double>::quiet_NaN() },
{ NAME_Infinity, std::numeric_limits<double>::infinity() },
{ NAME_Min_Denormal, std::numeric_limits<double>::denorm_min() }
Expand Down Expand Up @@ -885,6 +886,7 @@ void PFloat::SetSingleSymbols()
{ NAME_Min_Normal, FLT_MIN },
{ NAME_Max, FLT_MAX },
{ NAME_Epsilon, FLT_EPSILON },
{ NAME_Equal_Epsilon, (float)EQUAL_EPSILON },
{ NAME_NaN, std::numeric_limits<float>::quiet_NaN() },
{ NAME_Infinity, std::numeric_limits<float>::infinity() },
{ NAME_Min_Denormal, std::numeric_limits<float>::denorm_min() }
Expand Down

0 comments on commit 45334c1

Please sign in to comment.