1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

MCOL-4361 Replace pow(10.0, (double)scale) expressions with a static dictionary lookup.

This commit is contained in:
Alexander Barkov
2021-04-09 12:14:41 +04:00
parent fd720bfd7d
commit 362bfcd15e
13 changed files with 153 additions and 132 deletions

View File

@@ -828,7 +828,7 @@ inline float TreeNode::getFloatVal()
}
else
{
return (fResult.decimalVal.value / pow((double)10, fResult.decimalVal.scale));
return (float) fResult.decimalVal.decimal64ToXFloat<double>();
}
}
@@ -903,8 +903,7 @@ inline double TreeNode::getDoubleVal()
}
else
{
// this may not be accurate. if this is problematic, change to pre-calculated power array.
return (double)(fResult.decimalVal.value / pow((double)10, fResult.decimalVal.scale));
return fResult.decimalVal.decimal64ToXFloat<double>();
}
}
@@ -979,8 +978,7 @@ inline long double TreeNode::getLongDoubleVal()
}
else
{
// this may not be accurate. if this is problematic, change to pre-calculated power array.
return (long double)(fResult.decimalVal.value / pow((long double)10, fResult.decimalVal.scale));
return fResult.decimalVal.decimal64ToXFloat<long double>();
}
}