This commit is contained in:
myrrc 2020-12-18 18:24:31 +03:00
parent ed6d74b218
commit fbaa8d3951

View File

@ -236,19 +236,24 @@ struct DecimalBinaryOperation
return;
}
}
else if constexpr(is_multiply && (!is_decimal_a || !is_decimal_b))
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)
// BUG very bad solution
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<NativeResultType>(scale_a);
if constexpr(IsDecimalNumber<ResultType>)
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<NativeResultType>(scale_a);
else
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<Int64>(scale_a);
return;
}
else if (scale_b != 1)
{
for (size_t i = 0; i < size; ++i)
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<NativeResultType>(scale_b);
if constexpr(IsDecimalNumber<ResultType>)
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<NativeResultType>(scale_b);
else
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<Int64>(scale_b);
return;
}