rStats.js v1.3.0
    Preparing search index...

    Function factorial

    • Factorial. Equivalent to R's factorial(). Takes a single number: gamma(x + 1), defined for any real x that is not a negative integer.

      Parameters

      • x: number

        Argument.

      Returns number

      x! = Gamma(x + 1) (NaN at negative integers, Infinity on overflow).

      factorial(5);    // 120
      factorial(0.5); // 0.8862269254527579