Skip to content

Commit

Permalink
feat: add factorial scalar function (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth authored Sep 2, 2022
1 parent 7ed31f6 commit a4d6f35
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions extensions/functions_arithmetic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,29 @@ scalar_functions:
- name: x
value: fp64
return: fp64
-
name: "factorial"
description: >
Return the factorial of a given integer input.
The factorial of 0! is 1 by convention.
Negative inputs will raise an error.
impls:
- args:
- name: overflow
options: [ SILENT, SATURATE, ERROR ]
required: false
- value: i32
name: "n"
return: i32
- args:
- name: overflow
options: [ SILENT, SATURATE, ERROR ]
required: false
- value: i64
name: "n"
return: i64

aggregate_functions:
- name: "sum"
Expand Down

0 comments on commit a4d6f35

Please sign in to comment.