dbms: rename isNan to isNaN [#METR-15731]

This commit is contained in:
Andrey Mironov 2015-04-03 17:52:33 +03:00
parent 4ed57ac566
commit e267ba87f0
3 changed files with 14 additions and 14 deletions

View File

@ -874,14 +874,14 @@ struct IsInfiniteImpl
template <typename T> static bool execute(const T t) { return std::isinf(t); } template <typename T> static bool execute(const T t) { return std::isinf(t); }
}; };
struct IsNanImpl struct IsNaNImpl
{ {
static constexpr auto name = "isNan"; static constexpr auto name = "isNaN";
template <typename T> static bool execute(const T t) { return std::isnan(t); } template <typename T> static bool execute(const T t) { return std::isnan(t); }
}; };
using FunctionIsFinite = FunctionNumericPredicate<IsFiniteImpl>; using FunctionIsFinite = FunctionNumericPredicate<IsFiniteImpl>;
using FunctionIsInfinite = FunctionNumericPredicate<IsInfiniteImpl>; using FunctionIsInfinite = FunctionNumericPredicate<IsInfiniteImpl>;
using FunctionIsNan = FunctionNumericPredicate<IsNanImpl>; using FunctionIsNaN = FunctionNumericPredicate<IsNaNImpl>;
} }

View File

@ -336,7 +336,7 @@ void registerFunctionsMiscellaneous(FunctionFactory & factory)
factory.registerFunction<FunctionIsFinite>(); factory.registerFunction<FunctionIsFinite>();
factory.registerFunction<FunctionIsInfinite>(); factory.registerFunction<FunctionIsInfinite>();
factory.registerFunction<FunctionIsNan>(); factory.registerFunction<FunctionIsNaN>();
} }
} }

View File

@ -21,13 +21,13 @@ select isInfinite(-inf) = 1;
select isInfinite(nan) = 0; select isInfinite(nan) = 0;
select isNan(0) = 0; select isNaN(0) = 0;
select isNan(1) = 0; select isNaN(1) = 0;
select isNan(materialize(0)) = 0; select isNaN(materialize(0)) = 0;
select isNan(materialize(1)) = 0; select isNaN(materialize(1)) = 0;
select isNan(1/0) = 0; select isNaN(1/0) = 0;
select isNan(-1/0) = 0; select isNaN(-1/0) = 0;
select isNan(0/0) = 1; select isNaN(0/0) = 1;
select isNan(inf) = 0; select isNaN(inf) = 0;
select isNan(-inf) = 0; select isNaN(-inf) = 0;
select isNan(nan) = 1; select isNaN(nan) = 1;