factorial
relationalai.semantics.std.math
factorial(value: NumberValue) -> ExpressionCompute the factorial of a non-negative integer.
Parameters
(valueNumberValue) - The non-negative integer input.
Returns
Expression- AnExpressioncomputing the factorial. ReturnsInteger. If the input value is not statically known to be non-negative, but turns out to be negative at runtime, returnsNaN.
Raises
ValueError- If value can be computed statically and is negative.
Examples
Compute factorial:
select(math.factorial(5))select(math.factorial(Calculation.n))