f = Math.factorial(n);
This function returns product of all positive integers less
then or equal to input n
.
factorial(5); // = 120 factorial(0); // = 1
function factorial extends Modelica.Icons.Function; input Integer n(min = 0) "Positive integer"; output Integer f "Factorial of n"; end factorial;
Developed 2014 at the DLR Institute of System Dynamics and Control |