Expand description
§Factorion Math
The math functions used by factorion. (Factorials and related functions) All functions that take Integers, but internally use Floats, not only have a float alternative, but also take in a precision.
This crate uses rug in its interface. It is re-exported for convenience.
§Features
- k-factorials in exact, float, approximate, approximate digits
- termials in exact, float, approximate, approximate digits
- k-termials in exact, approximate, approximate digits
- subfactorials in exact, approximate, approximate digits
Calculations are split in areas:
- exact: integer calculation (accuracy)
- float: float calculation (decimals)
- approximate: approximation of integer calculation using float as a * 10^b (large numbers)
- approximate digits: approximation of integer calculation using float as 10^b (extremely large numbers)
Formulas and their derivations are available in MATH.md
Re-exports§
pub use rug;
Modules§
- recommended
- Recommended constants
Constants§
Functions§
- adjust_
approximate - Adjusts the output of
approximate_factorial, by combining the 10 exponents of the number and the extra exponent. - approximate_
approx_ termial - The k-termial of x * 10^e as a * 10^b
- approximate_
factorial - Calculates Sterling’s Approximation of large factorials. Returns a float with the digits, and an int containing the extra base 10 exponent.
- approximate_
factorial_ float - Calculates Sterling’s Approximation of large factorials. Returns a float with the digits, and an int containing the extra base 10 exponent.
- approximate_
multifactorial - Calculates an approximation of the multifactorial using the sterling aproximation and the fractional multifactorial algorithm.
- approximate_
multifactorial_ digits - Calculates the approximate digits of a multifactorial. This is based on the base 10 logarithm of Sterling’s Approximation.
- approximate_
multifactorial_ digits_ float - Calculates the approximate digits of a multifactorial. This is based on the base 10 logarithm of Sterling’s Approximation.
- approximate_
multifactorial_ float - Calculates an approximation of the multifactorial using the sterling aproximation and the fractional multifactorial algorithm.
- approximate_
subfactorial - The subfactorial of n as a * 10^b
- approximate_
subfactorial_ float - The subfactorial of n as a * 10^b
- approximate_
termial - The k-termial of n as a * 10^b
- approximate_
termial_ digits - The k-termial of n as 10^b
- approximate_
termial_ digits_ float - approximate_
termial_ float - The k-termial of n as a * 10^b
- factorial
- The k-factorial of n
- fractional_
factorial - The factorial of x (using gamma)
- fractional_
multifactorial - Calculates the k-factorial of x.
- fractional_
termial - The termial of x
- length
- Number of digits of n (log10, but 1 if 0)
- multitermial
- The k-termial of n
- negative_
multifacorial_ factor - The k-factorial of -n is the factorial of n-k times this factor (inf if None)
- subfactorial
- The subfactorial of n
- termial
- The termial of n