add float.equal_epsilon and double.equal_epsilon

This commit is contained in:
Ricardo Luís Vaz Silva 2023-09-06 19:34:23 -03:00 committed by Rachael Alexanderson
parent 86ca0cbecd
commit bf0e74447d
2 changed files with 3 additions and 0 deletions

View file

@ -139,6 +139,7 @@ xx(Max)
xx(Min_Normal)
xx(Min_Denormal)
xx(Epsilon)
xx(Equal_Epsilon)
xx(NaN)
xx(Infinity)
xx(Dig)

View file

@ -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() }
@ -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() }