#include #include #include #include namespace DB { namespace { struct IsInfiniteImpl { static constexpr auto name = "isInfinite"; template static bool execute(const T t) { if constexpr (std::is_same_v) return (bit_cast(t) & 0b01111111111111111111111111111111) == 0b01111111100000000000000000000000; else if constexpr (std::is_same_v) return (bit_cast(t) & 0b0111111111111111111111111111111111111111111111111111111111111111) == 0b0111111111110000000000000000000000000000000000000000000000000000; else { (void)t; return false; } } }; using FunctionIsInfinite = FunctionNumericPredicate; } REGISTER_FUNCTION(IsInfinite) { factory.registerFunction(); } }