functionfactorial

The product of all integer <= the input

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

f = Math.factorial(n);

Description

This function returns product of all positive integers less then or equal to input n.

Example

factorial(5);
// = 120
factorial(0);
// = 1

Inputs

TypeNameDefaultDescription
IntegernPositive integer

Outputs

TypeNameDefaultDescription
IntegerfFactorial of n

Revisions

DLR logo Developed 2014 at the DLR Institute of System Dynamics and Control