mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
dbms: remove square function, alter tests. [#METR-13613]
This commit is contained in:
parent
ea9472312e
commit
c6134124f6
@ -451,7 +451,6 @@ struct PiImpl
|
||||
static constexpr auto value = 3.1415926535897932384626433832795028841971693;
|
||||
};
|
||||
|
||||
struct SquareName { static constexpr auto name = "square"; };
|
||||
struct ExpName { static constexpr auto name = "exp"; };
|
||||
struct LogName { static constexpr auto name = "log"; };
|
||||
struct Exp2Name { static constexpr auto name = "exp2"; };
|
||||
@ -474,7 +473,6 @@ struct PowName { static constexpr auto name = "pow"; };
|
||||
|
||||
using FunctionE = FunctionMathNullaryConstFloat64<EImpl>;
|
||||
using FunctionPi = FunctionMathNullaryConstFloat64<PiImpl>;
|
||||
using FunctionSqr = FunctionMathUnaryFloat64<UnaryFunctionVectorized<SquareName, square>>;
|
||||
using FunctionExp = FunctionMathUnaryFloat64<UnaryFunctionVectorized<ExpName, exp>>;
|
||||
using FunctionLog = FunctionMathUnaryFloat64<UnaryFunctionVectorized<LogName, log>>;
|
||||
using FunctionExp2 = FunctionMathUnaryFloat64<UnaryFunctionVectorized<Exp2Name, exp2>>;
|
||||
|
@ -8,7 +8,6 @@ void registerFunctionsMath(FunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction<FunctionE>();
|
||||
factory.registerFunction<FunctionPi>();
|
||||
factory.registerFunction<FunctionSqr>();
|
||||
factory.registerFunction<FunctionExp>();
|
||||
factory.registerFunction<FunctionLog>();
|
||||
factory.registerFunction<FunctionExp2>();
|
||||
|
@ -72,7 +72,3 @@
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
|
@ -8,20 +8,15 @@ select abs(-128) = 128;
|
||||
select abs(127) = 127;
|
||||
select sum(abs(number - 10 as x) = (x < 0 ? -x : x)) / count() array join range(1000000) as number;
|
||||
|
||||
select square(0) = 0;
|
||||
select square(1) = 1;
|
||||
select square(2) = 4;
|
||||
select sum(square(x) = x * x) / count() array join range(1000000) as x;
|
||||
|
||||
select sqrt(0) = 0;
|
||||
select sqrt(1) = 1;
|
||||
select sqrt(4) = 2;
|
||||
select sum(sqrt(square(x)) = x) / count() array join range(1000000) as x;
|
||||
select sum(sqrt(x * x) = x) / count() array join range(1000000) as x;
|
||||
|
||||
select cbrt(0) = 0;
|
||||
select cbrt(1) = 1;
|
||||
select cbrt(8) = 2;
|
||||
select sum(abs(cbrt(x * square(x)) - x) < 1.0e-9) / count() array join range(1000000) as x;
|
||||
select sum(abs(cbrt(x * x * x) - x) < 1.0e-9) / count() array join range(1000000) as x;
|
||||
|
||||
select pow(1, 0) = 1;
|
||||
select pow(2, 0) = 1;
|
||||
@ -29,7 +24,7 @@ select sum(pow(x, 0) = 1) / count() array join range(1000000) as x;
|
||||
select pow(1, 1) = 1;
|
||||
select pow(2, 1) = 2;
|
||||
select sum(abs(pow(x, 1) - x) < 1.0e-9) / count() array join range(1000000) as x;
|
||||
select sum(pow(x, 2) = square(x)) / count() array join range(10000) as x;
|
||||
select sum(pow(x, 2) = x * x) / count() array join range(10000) as x;
|
||||
|
||||
select tgamma(0) = inf;
|
||||
select tgamma(1) = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user