1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Merge pull request #1856 from mariadb-corporation/bar-develop-MCOL-4361

MCOL-4361 Replace pow(10.0, (double)scale) expressions with a static …
This commit is contained in:
Gagan Goel
2021-04-13 07:01:33 -04:00
committed by GitHub
13 changed files with 153 additions and 132 deletions

View File

@ -97,8 +97,8 @@ Command* FilterCommand::makeFilterCommand(ByteStream& bs, vector<SCommand>& cmds
ColumnCommand* cmd0 = dynamic_cast<ColumnCommand*>(cmds[nc - 2].get());
ColumnCommand* cmd1 = dynamic_cast<ColumnCommand*>(cmds[nc - 1].get());
int scale0 = cmd0->getScale();
int scale1 = cmd1->getScale();
uint32_t scale0 = cmd0->getScale();
uint32_t scale1 = cmd1->getScale();
// char[] is stored as int, but cannot directly compare if length is different
// due to endian issue
@ -117,7 +117,8 @@ Command* FilterCommand::makeFilterCommand(ByteStream& bs, vector<SCommand>& cmds
else
{
ScaledFilterCmd* sc = new ScaledFilterCmd();
sc->setFactor(pow(10.0, scale1) / pow(10.0, scale0));
sc->setFactor(datatypes::scaleDivisor<double>(scale1) /
datatypes::scaleDivisor<double>(scale0));
fc = sc;
}