From a19934886028e6a8bf5320f15eea056c5fad3eb5 Mon Sep 17 00:00:00 2001 From: myrrc Date: Fri, 18 Dec 2020 18:26:58 +0300 Subject: [PATCH] fix2 --- src/Functions/FunctionBinaryArithmetic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Functions/FunctionBinaryArithmetic.h b/src/Functions/FunctionBinaryArithmetic.h index f3904ae764e..e0745e65c55 100644 --- a/src/Functions/FunctionBinaryArithmetic.h +++ b/src/Functions/FunctionBinaryArithmetic.h @@ -292,6 +292,28 @@ struct DecimalBinaryOperation return; } } + else if constexpr(is_multiply && (!is_decimal_a || !is_decimal_b)) // BUG very bad solution + { + if (scale_a != 1) + { + for (size_t i = 0; i < size; ++i) + if constexpr(IsDecimalNumber) + c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_a); + else + c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_a); + return; + } + else if (scale_b != 1) + { + for (size_t i = 0; i < size; ++i) + if constexpr(IsDecimalNumber) + c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_b); + else + c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_b); + + return; + } + } else if constexpr (is_division && is_decimal_b) { for (size_t i = 0; i < size; ++i)