1#include <Functions/FunctionNumericPredicate.h>
2#include <Functions/FunctionFactory.h>
3
4
5namespace DB
6{
7
8struct IsNaNImpl
9{
10 static constexpr auto name = "isNaN";
11 template <typename T>
12 static bool execute(const T t)
13 {
14 /// Suppression for PVS-Studio.
15 return t != t; //-V501
16 }
17};
18
19using FunctionIsNaN = FunctionNumericPredicate<IsNaNImpl>;
20
21
22void registerFunctionIsNaN(FunctionFactory & factory)
23{
24 factory.registerFunction<FunctionIsNaN>();
25}
26
27}
28