mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
30 lines
420 B
C++
30 lines
420 B
C++
#include <Functions/FunctionNumericPredicate.h>
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
namespace
|
|
{
|
|
|
|
struct IsNaNImpl
|
|
{
|
|
static constexpr auto name = "isNaN";
|
|
template <typename T>
|
|
static bool execute(const T t)
|
|
{
|
|
return t != t;
|
|
}
|
|
};
|
|
|
|
using FunctionIsNaN = FunctionNumericPredicate<IsNaNImpl>;
|
|
|
|
}
|
|
|
|
REGISTER_FUNCTION(IsNaN)
|
|
{
|
|
factory.registerFunction<FunctionIsNaN>();
|
|
}
|
|
|
|
}
|