MathLib.factorial()

MathLib.factorial() calculates the factorial of the argument. \[ \text{MathLib.factorial}(n) = n! \]

Specification

MathLib.factorial accepts one argument. Any additional arguments will be ignored. The type of the argument should be number . For other argument types see the unary function specification.
  1. MathLib.factorial(NaN) = NaN
  2. MathLib.factorial(+∞) = +∞
  3. MathLib.factorial(-∞) = NaN
  4. MathLib.factorial(n) = NaN if n<0 or n not an integer
  5. MathLib.factorial(n) = Infinity if n is an integer greater 170
  6. otherwise MathLib.factorial(n) = n!

Tests

Categories: unary Function