mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
modify return type from Int64 to UInt64
This commit is contained in:
parent
8a7c7bfb3d
commit
5eba20e119
@ -553,7 +553,7 @@ Result:
|
||||
|
||||
## factorial(n)
|
||||
|
||||
Computes the factorial of an integer value. It works with any native integer type including UInt(8|16|32|64) and Int(8|16|32|64). The return type is Int64.
|
||||
Computes the factorial of an integer value. It works with any native integer type including UInt(8|16|32|64) and Int(8|16|32|64). The return type is UInt64.
|
||||
|
||||
The factorial of 0 is 1. Likewise, the factorial() function returns 1 for any negative value. The maximum positive value for the input argument is 20, a value of 21 or greater overflows the range for Int64 and will cause exception throw.
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace ErrorCodes
|
||||
template <typename A>
|
||||
struct FactorialImpl
|
||||
{
|
||||
using ResultType = Int64;
|
||||
using ResultType = UInt64;
|
||||
static const constexpr bool allow_decimal = false;
|
||||
static const constexpr bool allow_fixed_string = false;
|
||||
static const constexpr bool allow_string_integer = false;
|
||||
@ -101,7 +101,7 @@ REGISTER_FUNCTION(Factorial)
|
||||
factory.registerFunction<FunctionFactorial>(
|
||||
{
|
||||
R"(
|
||||
Computes the factorial of an integer value. It works with any native integer type including UInt(8|16|32|64) and Int(8|16|32|64). The return type is Int64.
|
||||
Computes the factorial of an integer value. It works with any native integer type including UInt(8|16|32|64) and Int(8|16|32|64). The return type is UInt64.
|
||||
|
||||
The factorial of 0 is 1. Likewise, the factorial() function returns 1 for any negative value. The maximum positive value for the input argument is 20, a value of 21 or greater overflows the range for Int64 and will cause exception throw.
|
||||
)",
|
||||
|
Loading…
Reference in New Issue
Block a user