From d0bfb4e1f55d0409063f4e21b84a7cdf154ddae9 Mon Sep 17 00:00:00 2001 From: Bharat Nallan Chakravarthy Date: Thu, 23 Jun 2022 21:39:00 +0530 Subject: [PATCH] handle nan --- src/AggregateFunctions/QuantileApproximateWeighted.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AggregateFunctions/QuantileApproximateWeighted.h b/src/AggregateFunctions/QuantileApproximateWeighted.h index 7f6139e5de7..5a661d12111 100644 --- a/src/AggregateFunctions/QuantileApproximateWeighted.h +++ b/src/AggregateFunctions/QuantileApproximateWeighted.h @@ -190,6 +190,8 @@ struct QuantileApproximateWeighted g = std::numeric_limits::max(); else if (yl + (dy / dx) * (level - xl) < std::numeric_limits::min()) g = std::numeric_limits::min(); + else if (isNaN(yl + (dy / dx) * (level - xl))) + g = std::numeric_limits::quiet_NaN(); else g = yl + (dy / dx) * (level - xl); @@ -312,6 +314,8 @@ struct QuantileApproximateWeighted g = std::numeric_limits::max(); else if ((yl + (dy / dx) * (level - xl)) < std::numeric_limits::min()) g = std::numeric_limits::min(); + else if (isNaN(yl + (dy / dx) * (level - xl))) + g = std::numeric_limits::quiet_NaN(); else g = yl + (dy / dx) * (level - xl);