From 213767504740032338e41abe7996822aa766648a Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Sat, 22 May 2021 02:47:05 +0200 Subject: AK/NumericLimits: Add `lowest()` for floating-point types --- AK/NumericLimits.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AK/NumericLimits.h b/AK/NumericLimits.h index 783e3adbe3..66eb28f8ca 100644 --- a/AK/NumericLimits.h +++ b/AK/NumericLimits.h @@ -101,6 +101,7 @@ struct NumericLimits { #ifndef KERNEL template<> struct NumericLimits { + static constexpr float lowest() { return -__FLT_MAX__; } static constexpr float min() { return __FLT_MIN__; } static constexpr float max() { return __FLT_MAX__; } static constexpr float epsilon() { return __FLT_EPSILON__; } @@ -109,6 +110,7 @@ struct NumericLimits { template<> struct NumericLimits { + static constexpr double lowest() { return -__DBL_MAX__; } static constexpr double min() { return __DBL_MIN__; } static constexpr double max() { return __DBL_MAX__; } static constexpr double epsilon() { return __DBL_EPSILON__; } @@ -117,6 +119,7 @@ struct NumericLimits { template<> struct NumericLimits { + static constexpr long double lowest() { return -__LDBL_MAX__; } static constexpr long double min() { return __LDBL_MIN__; } static constexpr long double max() { return __LDBL_MAX__; } static constexpr long double epsilon() { return __LDBL_EPSILON__; } -- cgit v1.2.3