How can I express a factorial n! with an F# function, recursive or otherwise?
问题 A factorial of a natural number (any number greater or equal than 0 ) is that number multiplied by the factorial of itself minus one, where the factorial of 0 is defined as 1 . For example: 0! = 1 1! = 1 * 0! 2! = 2 * 1! 3! = 3 * 2! 4! = 4 * 3! 5! = 5 * 4! Another way of writing this is to multiply all natural numbers between 1 and n for n! : 5! = 1 * 2 * 3 * 4 * 5 How can I express this with a recursive function in F#? And should I do it with a recursive function? //Factorials! let factorial