1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -17,10 +17,10 @@
MA 02110-1301, USA. */
/****************************************************************************
* $Id: func_pow.cpp 3495 2013-01-21 14:09:51Z rdempsey $
*
*
****************************************************************************/
* $Id: func_pow.cpp 3495 2013-01-21 14:09:51Z rdempsey $
*
*
****************************************************************************/
#include <cstdlib>
#include <string>
@ -45,89 +45,80 @@ using namespace logging;
namespace funcexp
{
CalpontSystemCatalog::ColType Func_pow::operationType(FunctionParm& fp, CalpontSystemCatalog::ColType& resultType)
CalpontSystemCatalog::ColType Func_pow::operationType(FunctionParm& fp,
CalpontSystemCatalog::ColType& resultType)
{
// operation type is not used by this functor
return fp[0]->data()->resultType();
// operation type is not used by this functor
return fp[0]->data()->resultType();
}
double Func_pow::getDoubleVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
double Func_pow::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull, CalpontSystemCatalog::ColType&)
{
// null value is indicated by isNull
double base = parm[0]->data()->getDoubleVal(row, isNull);
// null value is indicated by isNull
double base = parm[0]->data()->getDoubleVal(row, isNull);
if (!isNull)
{
double exponent = parm[1]->data()->getDoubleVal(row, isNull);
if (!isNull)
{
double exponent = parm[1]->data()->getDoubleVal(row, isNull);
errno = 0;
double x = pow(base, exponent);
if (!isNull)
{
errno = 0;
double x = pow(base, exponent);
// @bug3490, 4461, rule out domain error, pole error and overflow range error.
if (!isfinite(x))
{
isNull = true;
Message::Args args;
args.add("pow");
args.add(base);
args.add(exponent);
unsigned errcode = ERR_FUNC_OUT_OF_RANGE_RESULT;
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(errcode, args), errcode);
}
// @bug3490, 4461, rule out domain error, pole error and overflow range error.
if (!isfinite(x))
{
isNull = true;
Message::Args args;
args.add("pow");
args.add(base);
args.add(exponent);
unsigned errcode = ERR_FUNC_OUT_OF_RANGE_RESULT;
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(errcode, args), errcode);
}
return x;
}
return x;
}
}
return 0.0;
return 0.0;
}
long double Func_pow::getLongDoubleVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
long double Func_pow::getLongDoubleVal(Row& row, FunctionParm& parm, bool& isNull,
CalpontSystemCatalog::ColType&)
{
// null value is indicated by isNull
long double base = parm[0]->data()->getLongDoubleVal(row, isNull);
// null value is indicated by isNull
long double base = parm[0]->data()->getLongDoubleVal(row, isNull);
if (!isNull)
{
// Should this be long double? Not sure on usage.
double exponent = parm[1]->data()->getDoubleVal(row, isNull);
if (!isNull)
{
// Should this be long double? Not sure on usage.
double exponent = parm[1]->data()->getDoubleVal(row, isNull);
errno = 0;
long double x = powl(base, (long double)exponent);
if (!isNull)
{
errno = 0;
long double x = powl(base, (long double)exponent);
// @bug3490, 4461, rule out domain error, pole error and overflow range error.
if (!isfinite(x))
{
isNull = true;
Message::Args args;
args.add("pow");
args.add((double)base);
args.add(exponent);
unsigned errcode = ERR_FUNC_OUT_OF_RANGE_RESULT;
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(errcode, args), errcode);
}
// @bug3490, 4461, rule out domain error, pole error and overflow range error.
if (!isfinite(x))
{
isNull = true;
Message::Args args;
args.add("pow");
args.add((double)base);
args.add(exponent);
unsigned errcode = ERR_FUNC_OUT_OF_RANGE_RESULT;
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(errcode, args), errcode);
}
return x;
}
return x;
}
}
return 0.0;
return 0.0;
}
} // namespace funcexp
} // namespace funcexp
// vim:ts=4 sw=4: