PHPSL Function:  bcFact( )

  • bcFact ($IntN)

    Dependencies: NONE


    This function computes the simple arbitrary-precision factorial of any positive integer (N), where its factorial (N!) is simply the product of all of the integers from 1 to (N) multiplied together, the exception being 0!, which is equated to 1, by definition.

    Because factorial values rapidly become extremely large, this function has a built-in limit of N = 9999, however this limit can be removed.  Factorials of integers over 10000 can take several seconds to compute and a script time-out may be possible if too extreme.

    n = 1 N n = 1 2 3   . . .   N


    Double-Click to select ALL code

    Double-Click to select ALL code


    EXAMPLE call results:
    
       print bcFact(5);
    // =--> 120
    
    
       print bcFact(10);
    // =--> 3628800
    
    
       print bcFact(41);
    // =--> 33452526613163807108170062053440751665152000000000
    
    

Jay Tanner - 2024