A function definition wraps up (abstracts) some computation: a complex computation can then be executed simply by calling the function. The function Factorial inplements the mathematical factorial concept. The example demonstrates that functions can call themselves (recursion).

Please note that this example also introduces the if control structure. If the expression N==0 returns true, then 1 is returned, otherwise Factorial is called recursively.