This commit is contained in:
myrrc 2020-12-18 18:26:58 +03:00
parent fbaa8d3951
commit a199348860

View File

@ -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<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)
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;
}
}
else if constexpr (is_division && is_decimal_b)
{
for (size_t i = 0; i < size; ++i)