factorial

fun factorial(n: Int): Long

Returns the factorial of n.

Defined for n in 0..20; 20! is the largest factorial that fits in a Long. Throws IllegalArgumentException when n is negative or greater than 20. factorial(0) is 1L.