diff --git a/Include/auROXTL/auNumericLimits.hpp b/Include/auROXTL/auNumericLimits.hpp index 7813e8c..ca0450d 100644 --- a/Include/auROXTL/auNumericLimits.hpp +++ b/Include/auROXTL/auNumericLimits.hpp @@ -29,6 +29,11 @@ struct _AuNonStdLimits { return Epsilon; } + + static constexpr Type lowest() + { + return min(); + } }; @@ -69,6 +74,8 @@ struct AuNumericLimits : AuNumericLimits #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 : _AuNonStdLimits @@ -94,38 +101,49 @@ struct _AuNonStdLimitsFP template <> struct AuNumericLimits : _AuNonStdLimitsFP { - 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 : _AuNonStdLimitsFP { - 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()); } }; \ No newline at end of file