[*] increase epsilon size for other quirks

match MSVCs ABI to some extent.
This commit is contained in:
Reece Wilson 2023-06-01 13:04:49 +01:00
parent 6c8bc1d01c
commit 6f13157ce3

View File

@ -29,6 +29,11 @@ struct _AuNonStdLimits
{
return Epsilon;
}
static constexpr Type lowest()
{
return min();
}
};
@ -69,6 +74,8 @@ struct AuNumericLimits<unsigned long> : AuNumericLimits<unsigned int>
#endif
// TODO: clang x86 and x64 will need different hacks for [unsigned] long long
// Update: reece: i dont care enough to fully support non--Au-types for now.
// will fix
template <>
struct AuNumericLimits<bool> : _AuNonStdLimits<bool, false, true, true>
@ -94,38 +101,49 @@ struct _AuNonStdLimitsFP
template <>
struct AuNumericLimits<float> : _AuNonStdLimitsFP<float>
{
static double max()
static constexpr float max()
{
return 340282346638528859811704183484516925440.0000000000000000;
return 340282346638528859811704183484516925440.0000000000000000f;
}
static double min()
// Techincally not compatible with C++11!
// This is techincally ::lowest() in real c++
static constexpr float min()
{
return -340282346638528859811704183484516925440.0000000000000000;
return -340282346638528859811704183484516925440.0000000000000000f;
}
static constexpr double epsilon()
static constexpr float epsilon()
{
return 0.000000000000000111;
return 1.192092896e-07F;
}
static constexpr float lowest()
{
return -(max());
}
};
template <>
struct AuNumericLimits<double> : _AuNonStdLimitsFP<double>
{
static double max()
static constexpr double max()
{
return 1.7976931348623157e+308;
return 1.7976931348623158e+308;
}
static double min()
static constexpr double min()
{
return -2.2250738585072014e-308;
}
static constexpr double epsilon()
{
return 0.000000000000000111;
return 2.2204460492503131e-016;
}
static constexpr double lowest()
{
return -(max());
}
};