Skip to content

factorial

relationalai.semantics.std.math
factorial(value: NumberValue) -> Expression

Compute the factorial of a non-negative integer.

Parameters

  • value

    (NumberValue) - The non-negative integer input.

Returns

  • Expression - An Expression computing the factorial. Returns Integer. An input outside 0 to 33 at run time has no value.

Raises

  • ValueError - If value can be computed statically and is negative.

Examples

Compute factorial:

select(math.factorial(5))
select(math.factorial(Calculation.n))