| Message ID | 20260918120949.191668-6-barnabas.pocze@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Barnabás Pőcze (2026-09-18 13:09:33) > For floating-point types `std::numeric_limits<T>::min()` is the smallest > normal positive value. So `lowest()` needs to be used other e.g. a value > of 0 will not be properly handled. > > This type is only used for logging, so no effects on the algorithm. > > Fixes: c2059585f3c7 ("libipa: awb_bayes: Add logging of value limits") > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > src/ipa/libipa/awb_bayes.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/ipa/libipa/awb_bayes.cpp b/src/ipa/libipa/awb_bayes.cpp > index 10e05962b8..7f3237c0ab 100644 > --- a/src/ipa/libipa/awb_bayes.cpp > +++ b/src/ipa/libipa/awb_bayes.cpp > @@ -66,7 +66,7 @@ class LimitsRecorder > public: > LimitsRecorder() > : min_(std::numeric_limits<T>::max()), > - max_(std::numeric_limits<T>::min()) > + max_(std::numeric_limits<T>::lowest()) > { > } > > -- > 2.55.0 >
On Fri, Sep 18, 2026 at 02:09:33PM +0200, Barnabás Pőcze wrote: > For floating-point types `std::numeric_limits<T>::min()` is the smallest > normal positive value. So `lowest()` needs to be used other e.g. a value > of 0 will not be properly handled. I'm not sure I understand the part after "to be used". Did you mean "otherwise" ? > > This type is only used for logging, so no effects on the algorithm. > > Fixes: c2059585f3c7 ("libipa: awb_bayes: Add logging of value limits") > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Thanks j > --- > src/ipa/libipa/awb_bayes.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/ipa/libipa/awb_bayes.cpp b/src/ipa/libipa/awb_bayes.cpp > index 10e05962b8..7f3237c0ab 100644 > --- a/src/ipa/libipa/awb_bayes.cpp > +++ b/src/ipa/libipa/awb_bayes.cpp > @@ -66,7 +66,7 @@ class LimitsRecorder > public: > LimitsRecorder() > : min_(std::numeric_limits<T>::max()), > - max_(std::numeric_limits<T>::min()) > + max_(std::numeric_limits<T>::lowest()) > { > } > > -- > 2.55.0 >
2026. 09. 23. 17:09 keltezéssel, Jacopo Mondi írta: > On Fri, Sep 18, 2026 at 02:09:33PM +0200, Barnabás Pőcze wrote: >> For floating-point types `std::numeric_limits<T>::min()` is the smallest >> normal positive value. So `lowest()` needs to be used other e.g. a value >> of 0 will not be properly handled. > > I'm not sure I understand the part after "to be used". > > Did you mean "otherwise" ? Yes, indeed! > >> >> This type is only used for logging, so no effects on the algorithm. >> >> Fixes: c2059585f3c7 ("libipa: awb_bayes: Add logging of value limits") >> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > Thanks > j > >> --- >> src/ipa/libipa/awb_bayes.cpp | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/src/ipa/libipa/awb_bayes.cpp b/src/ipa/libipa/awb_bayes.cpp >> index 10e05962b8..7f3237c0ab 100644 >> --- a/src/ipa/libipa/awb_bayes.cpp >> +++ b/src/ipa/libipa/awb_bayes.cpp >> @@ -66,7 +66,7 @@ class LimitsRecorder >> public: >> LimitsRecorder() >> : min_(std::numeric_limits<T>::max()), >> - max_(std::numeric_limits<T>::min()) >> + max_(std::numeric_limits<T>::lowest()) >> { >> } >> >> -- >> 2.55.0 >>
diff --git a/src/ipa/libipa/awb_bayes.cpp b/src/ipa/libipa/awb_bayes.cpp index 10e05962b8..7f3237c0ab 100644 --- a/src/ipa/libipa/awb_bayes.cpp +++ b/src/ipa/libipa/awb_bayes.cpp @@ -66,7 +66,7 @@ class LimitsRecorder public: LimitsRecorder() : min_(std::numeric_limits<T>::max()), - max_(std::numeric_limits<T>::min()) + max_(std::numeric_limits<T>::lowest()) { }
For floating-point types `std::numeric_limits<T>::min()` is the smallest normal positive value. So `lowest()` needs to be used other e.g. a value of 0 will not be properly handled. This type is only used for logging, so no effects on the algorithm. Fixes: c2059585f3c7 ("libipa: awb_bayes: Add logging of value limits") Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/libipa/awb_bayes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)