I am making fuction that calculate factorial in swift. like this
func factorial(factorialNumber: UInt64) -> UInt64 { if factorialNumber == 0 {
Here's a function that accepts any type that conforms to the Numeric protocol, which are all builtin number types.
Numeric
func factorial(_ x: N) -> N { x == 0 ? 1 : x * factorial(x - 1) }