- Dr. Alistair Ward
- Provides implementations of the class
- Provides additional functions related to factorials, but which depends on a specific implementation, and which therefore can't be accessed throught the class-interface.
The algorithms by which factorial has been implemented.
The integers from which the factorial is composed, are multiplied using
The prime factors of the factorial are extracted, then raised to the appropriate power, before multiplication.
|:: Integral base|
The number, whose factorial is to be factorised.
|-> Factors base base|
The base and exponent of each prime factor in the factorial, ordered by increasing base (and decreasing exponent).
- Returns the prime factors, of the factorial of the specifed integer.
- Precisely all the primes less than or equal to the specified integer n, are included in n!; only the multiplicity of each of these known prime components need be determined.
- CAVEAT: currently a hotspot.
|:: Integral i|
The lower bound of the integer-range, whose product is returned.
The number of integers in the range above.
Returns the rising factorial; http://mathworld.wolfram.com/RisingFactorial.html
|:: Integral i|
The upper bound of the integer-range, whose product is returned.
The number of integers in the range beneath.
Returns the falling factorial; http://mathworld.wolfram.com/FallingFactorial.html
- Returns the ratio of two factorials.
- It is more efficient than evaluating both factorials, and then dividing.
- For more complex combinations of factorials, such as in the Binomial coefficient,
extract the prime factors using
primeFactorsthen manipulate them using the module Data.PrimeFactors, and evaluate it using by Data.PrimeFactors.product'.