aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Functions/radians.cpp
blob: 2c2c2743532bc4c723292ddc53356c1eff2a65c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <DataTypes/IDataType.h>
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionMathUnary.h>


namespace DB
{
namespace
{
    struct RadiansName
    {
        static constexpr auto name = "radians";
    };

    Float64 radians(Float64 d)
    {
        Float64 radians = d * (M_PI / 180);
        return radians;
    }

    using FunctionRadians = FunctionMathUnary<UnaryFunctionVectorized<RadiansName, radians>>;
}

REGISTER_FUNCTION(Radians)
{
    factory.registerFunction<FunctionRadians>({}, FunctionFactory::CaseInsensitive);
}

}