You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Fix abs() usage for Ubuntu 18.04
abs(unsigned long long) is not a thing so Ubuntu 18.04 compiling fails. Using std::fabs() instead which handles this better (casts as double).
This commit is contained in:
@ -304,8 +304,8 @@ mcsv1_UDAF::ReturnCode Moda_impl_T<T>::evaluate(mcsv1Context* context, static_an
|
|||||||
else if (iter->second == maxCnt)
|
else if (iter->second == maxCnt)
|
||||||
{
|
{
|
||||||
// Tie breaker: choose the closest to avg. If still tie, choose smallest
|
// Tie breaker: choose the closest to avg. If still tie, choose smallest
|
||||||
if ((abs(val-avg) > abs(iter->first-avg))
|
if ((std::fabs(val-avg) > std::fabs(iter->first-avg))
|
||||||
|| ((abs(val-avg) == abs(iter->first-avg)) && (abs(val) > abs(iter->first))))
|
|| ((std::fabs(val-avg) == std::fabs(iter->first-avg)) && (std::fabs(val) > std::fabs(iter->first))))
|
||||||
{
|
{
|
||||||
val = iter->first;
|
val = iter->first;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user