diff --git a/extensions/functions_arithmetic_decimal.yaml b/extensions/functions_arithmetic_decimal.yaml index b62c63484..976a725ed 100644 --- a/extensions/functions_arithmetic_decimal.yaml +++ b/extensions/functions_arithmetic_decimal.yaml @@ -102,7 +102,7 @@ scalar_functions: scale_after_borrow = max(init_scale - delta, min_scale) scale = init_prec > 38 ? scale_after_borrow : init_scale DECIMAL - - + - name: "abs" description: Calculate the absolute value of the argument. impls: @@ -111,6 +111,23 @@ scalar_functions: value: decimal return: decimal + - name: "sqrt" + description: Square root of the value. Sqrt of 0 is 0 and sqrt of negative values will raise an error. + impls: + - args: + - name: x + value: "DECIMAL" + return: fp64 + - name: "factorial" + description: > + Return the factorial of a given decimal input. Scale should be 0 for factorial decimal input. + The factorial of 0! is 1 by convention. Negative inputs will raise an error. + Input which cause overflow of result will raise an error. + impls: + - args: + - name: "n" + value: "DECIMAL" + return: "DECIMAL<38,0>" aggregate_functions: - name: "sum" description: Sum a set of values.