From a8cf5508642169ae7d1aa2a2b1206bc2270871fe Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 14 Dec 2012 18:47:50 +0000 Subject: [PATCH] dbms: addition to prev. revision [#CONV-2944]. --- dbms/include/DB/Functions/FunctionsMiscellaneous.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbms/include/DB/Functions/FunctionsMiscellaneous.h b/dbms/include/DB/Functions/FunctionsMiscellaneous.h index 3d365648da3..d2fc2430d2e 100644 --- a/dbms/include/DB/Functions/FunctionsMiscellaneous.h +++ b/dbms/include/DB/Functions/FunctionsMiscellaneous.h @@ -51,6 +51,8 @@ static void numWidthVector(const std::vector & a, std::vector & c) for (size_t i = 0; i < size; ++i) if (a[i] >= 0) c[i] = a[i] ? 1 + log10(a[i]) : 1; + else if (std::tr1::is_signed::value && a[i] == std::numeric_limits::min()) + c[i] = 2 + log10(std::numeric_limits::max()); else c[i] = 2 + log10(-a[i]); }