factorial function

double factorial(
  1. num n
)

Returns the factorial based on the gamma function.

Implementation

double factorial(num n) => n < 0.0 ? double.nan : gamma(1.0 + n);